Class: MooTime

Inherits:
Time
  • Object
show all
Defined in:
lib/rambo/time.rb

Constant Summary collapse

RFC2822_DAY_NAME =
[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
RFC2822_MONTH_NAME =
[ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]

Instance Method Summary collapse

Instance Method Details

#httpdateObject



4
5
6
7
8
9
10
# File 'lib/rambo/time.rb', line 4

def httpdate
  t = dup.utc
  sprintf('%s, %02d %s %d %02d:%02d:%02d GMT',
    RFC2822_DAY_NAME[t.wday],
    t.day, RFC2822_MONTH_NAME[t.mon-1], t.year,
    t.hour, t.min, t.sec)
end