Skip to content
class method

DateTime.httpdate

(::String str, ?::Integer start) -> ::DateTime
DateTime.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=Date::ITALY]) → datetime

Creates a new DateTime object by parsing from a string according to some RFC 2616 format.

Example
DateTime.httpdate('Sat, 03 Feb 2001 04:05:06 GMT')
                          #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>

Raise an ArgumentError when the string length is longer than limit. You can stop this check by passing limit: nil, but note that it may take a long time to parse.

See also .commercial .iso8601 .civil .jd also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0