Hello Time Travelers,

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.


In reply to converting Time::HiRes by Lhamo Latso

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":