How would I go about converting this time string to epoch time in ruby? -
how go converting 2012-12-13t14:43:35.371z epoch time?
one approach considering strip t , z , seek utilize datetime library find way convert epoch. before go downwards path, curious if there gem utilize quickly. on related note, doing time calculations after convert epoch.
for example:
require 'date' # integer: datetime.parse('2012-12-13t14:43:35.371z').to_time.to_i # or string: datetime.parse('2012-12-13t14:43:35.371z').strftime('%s')
ruby time
No comments:
Post a Comment