- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
sub parse_http_date($)
{
my ($date)=@_;
my %months=(Jan=>0,Feb=>1,Mar=>2,Apr=>3,May=>4,Jun=>5,Jul=>6,Aug=>7,Sep=>8,Oct=>9,Nov=>10,Dec=>11);
if($date=~/^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$/)
{ return eval { timegm($6,$5,$4,$1,$months{$2},$3-1900) } }
return undef;
}