Forum Moderators: coopster & phranque

Message Too Old, No Replies

Converting the date/time field in apache logs

...into Unix format

         

sugarkane

3:57 pm on Apr 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone know of an easy way to convert the date field of an apache log entry into the Unix seconds format (using Perl)?

I think I could probably knock something up using regular expressions etc, but I'm sure I've seen a ready-rolled module out there somewhere...

Any ideas?

theperlyking

11:12 pm on Apr 21, 2001 (gmt 0)

10+ Year Member



Have a look at

[theoryx5.uwinnipeg.ca...]

sugarkane

7:29 pm on Apr 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks tpk, that looks like it's halfway to what I want.

However, I'm being really lazy about this ;) I'm sure I've seen some module somewhere that will take a date in the format [01/Apr/2001:15:50:15 +0000] and spit out the time in seconds... has anyone else come across this or am I imagining things again?

sugarkane

9:28 pm on Apr 25, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I've found it :)

Date::Parse [engelschall.com] is exactly what I needed...

Does anyone know of any good sites that list available Perl modules in a slightly more descriptive way than CPAN? It's often hard to know where to start looking there...