APIdock / Ruby
/
method

httpdate

ruby latest stable - Class: Time
httpdate()
public

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).

You must require ‘time’ to use this method.

# File lib/time.rb, line 654
 def httpdate
 t = dup.utc
 sprintf('%s, %02d %s %0*d %02d:%02d:%02d GMT',
 RFC2822_DAY_NAME[t.wday],
 t.day, RFC2822_MONTH_NAME[t.mon-1], t.year < 0 ? 5 : 4, t.year,
 t.hour, t.min, t.sec)
 end

AltStyle によって変換されたページ (->オリジナル) /