in reply to How do I find difference between two timestamps?
The timegm function in Time::Local can convert a Zulu (GMT) time into a timestamp. Since your date formats are nonstandard, it would be simplest to break out the year, month, day, hours, minutes, and seconds with a regular expression or substrings, then do:
These times can be subtracted to give differences in seconds. You'll have to subtract the milliseconds separately and add that to the difference.$time = timegm($sec,$min,$hour,$mday,$mon,$year);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do I find difference between two timestamps?
by tomhukins (Curate) on Nov 16, 2004 at 17:23 UTC | |
by tall_man (Parson) on Nov 16, 2004 at 18:22 UTC | |
by tomhukins (Curate) on Nov 16, 2004 at 23:04 UTC |
In Section
Seekers of Perl Wisdom