Re: Looping Dates.

[email protected] (Anagram)
Newsgroups perl.beginners.cgi
Organization http://groups.google.com
Message-ID <0716bf5e-47d1-4522-9224-6502bf488eac@d21g2000prf.googlegroups.com>
Sara -
  You should look at perldoc.perl.org for the date-time related
functions. You don't really need any special modules, though they can
sometimes be helpful.
  Here is a key idea: dates in perl (and many other computer languages
& systems) are stored as an integer number that represents the number
of _seconds_ since "the epoch" (usually Jan 1, of 1970 when dealing
with UNIXy things). Now if each day has 60 seconds per minute and 60
minutes per hour and 24 hours per day, you can figure out how many
seconds per day there are, and just add that number of seconds to a
running date-time variable to advance to the next day.
  Now just combine that idea with the useful built-in date and time
functions and you are all set. I must stress that you must read the
documentation on the functions, they don't work in an entirely
intuitive way, but once you understand the details you will see that
they are very useful and flexible.
  - Anagram
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.