use Time::Local;
With this you can convert it to epoch time which then becomes a simple
numeric comparison.
-----Original Message-----
From: Dennis Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 11:36 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Compare timestamp using localtime objects
How do I compare a timestamp using a logical operator >?
here is the problem I want to find any errors in my log from the last hour.
The log file has a timestamp with the local time format.
Wed Apr 11 22:05:09 2001
localtime(time-360)<'Wed Apr 11 22:05:09 2001'
How can I make the string Wed Apr 11 22:05:09 2001 into a localtime object
that I can use for comparisons.
Thanks
Dennis
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users