Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Date._httpdate

Date._httpdate(string, limit: 128) → hash

Returns a hash of values parsed from string, which should be a valid HTTP date format:

Example
d = Date.new(2001, 2, 3)
s = d.httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT"
Date._httpdate(s)
# => {:wday=>6, :mday=>3, :mon=>2, :year=>2001, :hour=>0, :min=>0, :sec=>0, :zone=>"GMT", :offset=>0}

Related: Date.httpdate (returns a Date object).

See also .gregorian_leap? .httpdate .commercial ._iso8601 also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0