End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#rfc822
rfc822
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
Returns a new Date object with values parsed from string, which should be a valid RFC 2822 date format:
Example
d = Date.new(2001, 2, 3) s = d.rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000" Date.rfc2822(s) # => #<Date: 2001-02-03>
See:
-
Argument start.
-
Argument limit.
Date.rfc822 is an alias for Date.rfc2822.
Related: Date._rfc2822 (returns a hash).