"Shane Laffin" <[EMAIL PROTECTED]> writes:

> Hello List,
> 
>       How do I compare two dates in the format:
> 
>               Thu Aug 15 2002 15:12:02
> 
>       to return if one date is higher than the other.
> 
> Does anyone have any ideas on suitable modules, most
> the date modules I have looked at dont deal with this
> date format.
> 
> Any help or pointers would be great.

Sure,

'
#!/usr/bin/perl -w

use Date::Parse;

my $time = str2time("Thu Aug 15 2002 15:12:02");  #now in 'unixtime'
print $time;                    #   '1029438722'
print scalar localtime($time);  #   'Thu Aug 15 15:12:02 2002'
'

Run both your dates through Date::Parse, and compare them numerically.

Good enough?

-RN

-- 

Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to