Actions
Bug #4975
closedDateTime.civil calculates seconds incorrectly with fractional offsets
Description
Ruby Version 1.9.2p180
DateTime.civil(2011, 5, 13, 17, 31, 13, -0.25).sec # => 12
Updated by naruse (Yui NARUSE) over 13 years ago
- Status changed from Open to Assigned
- Assignee set to tadf (tadayoshi funaba)
Updated by tadf (tadayoshi funaba) over 13 years ago
- Status changed from Assigned to Rejected
- Priority changed from Normal to 3
The contagion of flonum affects the determination of date and time.
You may give it as a rational number or a string.
DateTime.new(2011,5,13,17,31,13,Rational('-0.25'))
#=> #<DateTime: 2011-05-13T17:31:13-06:00 (212172089473/86400,-1/4,2299161)>
DateTime.new(2011,5,13,17,31,13,Rational(-1,4))
#=> #<DateTime: 2011-05-13T17:31:13-06:00 (212172089473/86400,-1/4,2299161)>
DateTime.new(2011,5,13,17,31,13,'-06:00')
#=> #<DateTime: 2011-05-13T17:31:13-06:00 (212172089473/86400,-1/4,2299161)>
Actions
Like0
Like0Like0