End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Time#httpdate
httpdate
lib/time.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/time.rb, line 689
def httpdate
getutc.strftime('%a, %d %b %Y %T GMT')
end
Returns a string which represents the time as RFC 1123 date of HTTP-date defined by RFC 2616:
day-of-week, DD month-name CCYY hh:mm:ss GMT
Note that the result is always UTC (GMT).
Example
require 'time' t = Time.now t.httpdate # => "Thu, 06 Oct 2011 02:26:12 GMT"
You must require ‘time’ to use this method.