From: Peter Rabbitson <[EMAIL PROTECTED]>
To: beginners@perl.org
Date: Tuesday, April 5, 2005, 5:03:09 PM
Subject: datetime comparisons



  Tuesday, April 5, 2005, 5:03:09 PM, you wrote:

  > On Tue, Apr 05, 2005 at 04:12:31PM +0300, John wrote:
>> hello all
>> 
>> i am wondering a there is a module that do comparisons
>> between two different datetime stamps
>> 
>> for example
>> 
>> 2/4/2005:15:20:20 and 4/4/2005:12:09:23
>> 
>> which date is bigger (namely earliest)
>> 

> I was down this road some time ago myself - definitely DateTime by Dave
> Rolsky. While it is not the most compact and not the fastest solution it has
> it all. Saved me way too many time from reinventing the wheel. On the other
> hand if your application is rather small and is guaranteed to stay small
> (which is usually not the case) you might look into other possibilities like
> simple numerical acrobatics with Time::Local (e.g. converting everything to
> epoch seconds and working from there). 



DateTime helped and me.

The comparison is made easy with two datetime objects.

Thanks



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to