#Convert Apache logfile time to unix epoch seconds #The only real limitation here is that we MUST stay in the same #timezone as the originating writer, that is, this doesn't support #variable timezones. However, it IS three times as fast as # Time::ParseDate's parsedate() function.
sub apache2epoch { use POSIX; my $i=0; my %months; %months = map { $_ => $i++ } ("Jan","Feb","Mar","Apr","May","J +un", "Jul","Aug","Sep","Oct","Nov","Dec"); $_[0] =~ m((\d+)/(\w+)/(\d+):(\d+):(\d+):(\d+)); return &mktime($6,$5,$4,$1,$months{$2},$3-1900,0,0,-1); }