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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.