Parse a time string using the formats specified by RFC 2616 and (non-RFC-compliant) IIS date format.
Supported formats:
Time::Format::HTTP_DATE.parse("Sun, 14 Feb 2016 21:00:00 GMT") # => 2016-02-14 21:00:00 UTC Time::Format::HTTP_DATE.parse("Sunday, 14-Feb-16 21:00:00 GMT") # => 2016-02-14 21:00:00 UTC Time::Format::HTTP_DATE.parse("Sun, 14-Feb-2016 21:00:00 GMT") # => 2016-02-14 21:00:00 UTC Time::Format::HTTP_DATE.parse("Sun Feb 14 21:00:00 2016") # => 2016-02-14 21:00:00 UTC Time::Format::HTTP_DATE.format(Time.utc(2016, 2, 15)) # => "Mon, 15 Feb 2016 00:00:00 GMT"
Formats a Time
into the given io.
Parses a string into a Time
.
Formats a Time
into the given io.
time is always converted to UTC.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Time/Format/HTTP_DATE.html