Perl Monk, Perl Meditation | |
PerlMonks |
(jeffa) Re: File manipulationby jeffa (Bishop) |
on Mar 09, 2001 at 21:55 UTC ( [id://63287]=note: print w/replies, xml ) | Need Help?? |
I prefer to store all of my timestamps as epoch seconds.
Perl's built-in time returns the number of epoch seconds
since January 1, 1970. As long as you have the epoch seconds,
you can always figure the rest out. It's a good consistent
trick to have.
For example: pick a date, what was date before that? If you picked Jan 15 then the answer is Jan 14, no matter what year. But what if you picked March 1? However, by taking advantage of epoch seconds, you can easily figure out what yesterday was:
Jeff
In Section
Seekers of Perl Wisdom
|
|