Skip to content

Instantly share code, notes, and snippets.

@mindreframer
Created September 28, 2013 21:29
Show Gist options
  • Save mindreframer/6746829 to your computer and use it in GitHub Desktop.
Save mindreframer/6746829 to your computer and use it in GitHub Desktop.
ruby 2.0.0 Time.iso8601 swallowing milliseconds....
[~] rvm use 2.0.0 23:22:47
Using /Users/roman/.rvm/gems/ruby-2.0.0-p247
[~] ruby -v -rtime -e 'p Time.iso8601("2013-12-11T12:09:08.123+02:00").to_f' 23:23:22
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
1386756548.0
[~] rvm use ruby-1.9.3-p392-turbo 23:23:24
Using /Users/roman/.rvm/gems/ruby-1.9.3-p392-turbo
[~] ruby -v -rtime -e 'p Time.iso8601("2013-12-11T12:09:08.123+02:00").to_f' 23:23:29
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.0]
1386756548.1230001
@kiranbiliyawala
Copy link

Hey,
I'm facing same problem with iso8601. Did you get solution around this?

@sugarfree1
Copy link

Same problem on ruby-2.2.4

> ruby -v -rtime -e 'p Time.iso8601("2015-07-18T13:18:40.062Z").iso8601'
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]
"2015-07-18T13:18:40Z"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment