Lhamo Latso has asked for the wisdom of the Perl Monks concerning the following question:
I am having trouble converting gettimeofday values back to a formatted date. I am using the Time::HiRes module as a test for some hi-res Oracle tim values. The tim values are in microseconds. To no surprise, my results using Time::HiRec are similarly way off, just like the Oracle tim values.
use Time::HiRes qw(gettimeofday); my $t0 = [gettimeofday]; print "t0: ". localtime($t0) ."\n"; print "trc msec: ". localtime(1068916117987100) ."\n"; print "trc sec: ". localtime(1068916117) ."\n";
My results:
t0: Mon Apr 15 04:20:16 1974 trc msec: Wed Dec 31 17:59:59 1969 trc sec: Sat Nov 15 11:08:37 2003
The date of the "trc msec:" is 2004-09-07 10:15:04, not Nov-2003.
Thanks for any help and direction. This is Perl v5.6.1 on RedHat Linux.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: converting Time::HiRes
by BrowserUk (Patriarch) on Sep 14, 2004 at 00:48 UTC | |
|
Re: converting Time::HiRes
by tachyon (Chancellor) on Sep 14, 2004 at 01:51 UTC | |
by Lhamo Latso (Scribe) on Sep 14, 2004 at 06:20 UTC | |
by tachyon (Chancellor) on Sep 14, 2004 at 07:23 UTC | |
by tachyon (Chancellor) on Sep 14, 2004 at 06:58 UTC | |
by poulhs (Beadle) on Oct 04, 2012 at 14:30 UTC |