-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
This is probably a regression from the recent date.rb rewrite #5076.
Environment
- jruby 9.2.0.0-SNAPSHOT (2.4.1) 2018-03-25 b0f7aaf OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12 +jit [linux-x86_64]
- Linux linuxdev 4.13.0-37-generic #42-Ubuntu SMP Wed Mar 7 14:13:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Expected Behaviour
DateTime.jd should set the sec_fraction of the instantiated DateTime. For example, with JRuby 9.1.16.0:
$ jruby -rdate -e'jd=2123888220001/864000r; d=DateTime.jd(jd); puts d; puts d.sec_fraction'
2018-03-25T23:00:00+00:00
1/10
The jd value was calculated as:
(86400 * DateTime.new(1970, 1, 1).jd + Time.utc(2018, 3, 25, 23).to_i)/86400r + 1/864000rActual Behaviour
The current version of DateTime.jd on master discards the fractional part of the second, leaving sec_fraction set to 0:
$ jruby -rdate -e'jd=2123888220001/864000r; d=DateTime.jd(jd); puts d; puts d.sec_fraction'
2018-03-25T23:00:00+00:00
0/1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels