Re: Time Comparison Easier Than I'm Making them
- From: noreply@xxxxxxxxx (Gunnar Hjalmarsson)
- Date: Wed, 28 Nov 2007 16:45:53 +0100
Mathew Snyder wrote:
I've got an application which uses the format yyyy-mm-dd hh:mm:ss for its
timestamping. I'm trying to determine if the time a record was created was 5 or
more minutes before the time the script runs.
use Date::Parse;
my $rectime = str2time '2007-11-28 16:40:11';
print $rectime + 300 <= time ? '5 or more' : 'Less than 5',
" minutes\n";
All I'm trying to do is take the hh:mm:ss portion of each timestamp and find the
difference
What if the record was created at 23:58?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- References:
- Time Comparison Easier Than I'm Making them
- From: Mathew Snyder
- Time Comparison Easier Than I'm Making them
- Prev by Date: RE: fixed list combinatorics
- Next by Date: Re: Time Comparison Easier Than I'm Making them
- Previous by thread: Re: Time Comparison Easier Than I'm Making them
- Next by thread: Re: Time Comparison Easier Than I'm Making them
- Index(es):
Relevant Pages
|