class ActiveSupport::TimeZone
def strptime(str, format, now = now())
components are supplied, then the day of the month defaults to 1:
However, if the date component is not provided, but any other upper
Time.zone.strptime('22:30:00', '%H:%M:%S') # => Fri, 31 Dec 1999 22:30:00 HST -10:00
Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00
TimeZone#now:
If upper components are missing from the string, they are supplied from
Time.zone.strptime('1999-12-31 14:00:00', '%Y-%m-%d %H:%M:%S') # => Fri, 31 Dec 1999 14:00:00 HST -10:00
Time.zone = 'Hawaii' # => "Hawaii"
In either case, the returned TimeWithZone has the timezone of +self+.
(This is the same behavior as +parse+.)
unless +format+ includes an explicit time zone.
Assumes that +str+ is a time in the time zone +self+,
Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone.
def strptime(str, format, now = now()) parts_to_time(DateTime._strptime(str, format), now) end