Project

General

Profile

Bug #10904 » strptime-s-n-format-sec-fraction-fix.2.patch

frsyuki (Sadayuki Furuhashi), 02/26/2015 01:04 AM

View differences:

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
(2-2/2)