Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your link is broken. Try The Many Dates and Times of Perl. Your suggestion to read this article is spot on. It is definitely worth reading. You've got to be careful doing epoch calculations. What happens over daylight savings time shifts? You can have a 23 or 25 hour day. Depending on the time you run your script you can wind up with the wrong date. There are other opportunities for errors as well. In most cases, you are better off using a library like DateTime (my personal favorite) to handle these calculations. Other options are mentioned in the article you suggested. To get a date two weeks from now with DateTime simply write:
That seems easier to understand than adding 2*7*24*60*60. It also is less likely to generate an error.
In reply to Re^2: Finding the dates for the reminder mail system
by TGI
|
|