Home  |  Linux  | Mysql  | PHP  | XML
From:Anagram Date:Fri Jan 25 11:57:20 2008
Subject:Re: Looping Dates.
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

Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants