In general, when I need to do any sort of interaction with dates and times, and especially if I need to do math, I use the DateTime module. It handles all this in a clean, consistent way.
If you are disinclined to go outside built-ins, I would suggest using GMT for all your times rather than mixing. You can then either log in GMT, or do the conversion on output. Playing games with differing internal representations just creates unnecessary headaches in my experience. In this case, just consistently calling gmtime will "force Perl to PERMANENTLY consider I am working in GMT+0 location", rather than creating a strange hack that will confuse you next time you have to work with this module and may possibly cause messy action at a distance.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||