Unix time is in UTC, based from the Epoch time. So just subtract all times from the start time. This will be number of seconds since the input file started collecting data.
You can calculate the hours manually: 60 seconds * 60 min = 1 hour. All days have 24 hours since we are dealing with GMT(UTC) time instead of funny daylight savings time.
Alternately, you can use any of the epoch to string functions like the use POSIX qw(strftime); module directly on this new start of data quasi epoch time. Just ignore the Jan 1970 stuff and only care about hour and day of month.
Update: whipped out my calculator, 1291154399 - 1290895200 = 259199. 60 sec * 60 sec/min *24 hours/day *3 days = 259200 seconds. So I'd keep it simple. Subtract 1290895200 from all the rest of the times. Hour one is from 0 to 60*60*1 seconds, hour 2 from that until 60*60*2 seconds, etc.
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.