On Apr 26, Tara Calishain said:

>I need to back up two days from localtime and I can't figure out how to do
>it. Currently I'm doing this just so I can work out the rest of the program:
>
>($day, $month, $year) = (localtime) [3,4,5]; #getting your local time 

The generic (read: potentially unsafe) way is to fix the problem right
there:

  ($day, $month, $year) = (localtime(time - 86400*2))[3,4,5];

The only place to worry about this is during the switch to/from Daylight
Savings Time, at 2:00 am, twice a year.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to