Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: JRuby 1.6
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:OSX 10.6.7, JRuby 1.6.0 (via rvm) in --1.9 mode
-
Number of attachments :
Description
In --1.9 mode the nanoseconds part is dropped when Time#iso8601 is passed an argument:
ruby --1.8 -rtime -e 'p Time.utc(2010, 12, 31, 23, 59, 59, 1).iso8601(9)' # => "2010-12-31T23:59:59.000001000Z" ruby --1.9 -rtime -e 'p Time.utc(2010, 12, 31, 23, 59, 59, 1).iso8601(9)' # => "2010-12-31T23:59:59.000000000Z"
With 1.9, time library ends up calling Time#subsec (https://github.com/ruby/ruby/blob/d737ae54496e6ea5a4d9f054245503ca06a5bfcd/lib/time.rb#L524) to construct that part of the formatted string. Right now, we discard anything below milliseconds inside that method, since JVM does not provide that level of temporal granularity. (https://github.com/jruby/jruby/blob/36b741d4e6f9c870cfb7c3467ff3726eac0f5795/src/org/jruby/RubyTime.java#L645)
Is there anything we can do to get around this problem?