Bug #10904 » strptime-s-n-format-sec-fraction-fix.2.patch
lib/time.rb | ||
---|---|---|
d = Date._strptime(date, format)
|
||
raise ArgumentError, "invalid strptime format - `#{format}'" unless d
|
||
if seconds = d[:seconds]
|
||
t = Time.at(seconds)
|
||
if sec_fraction = d[:sec_fraction]
|
||
usec = sec_fraction * 1000000
|
||
usec *= -1 if seconds < 0
|
||
else
|
||
usec = 0
|
||
end
|
||
t = Time.at(seconds, usec)
|
||
if zone = d[:zone]
|
||
force_zone!(t, zone)
|
||
end
|
- « Previous
- 1
- 2
- Next »