End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#rfc822
d.rfc822 → string
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_rfc2822(VALUE self)
{
return strftimev("%a, %-d %b %Y %T %z", self, set_tmx);
}
Alias of #rfc2822
Creates a new Date object by parsing from a string according to some typical RFC 2822 formats.
Example
Date.rfc2822('Sat, 3 Feb 2001 00:00:00 +0000') #=> #<Date: 2001-02-03 ...>
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.