Method: Time#httpdate
- Defined in:
- lib/time.rb
#httpdate ⇒ Object
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).
require 'time'
t = Time.now
t.httpdate # => "Thu, 06 Oct 2011 02:26:12 GMT"
You must require ‘time’ to use this method.
695 696 697 |
# File 'lib/time.rb', line 695 def httpdate getutc.strftime('%a, %d %b %Y %T GMT') end |