go ahead... be a heretic | |
PerlMonks |
Loop through epoch daysby Scrat (Monk) |
on Sep 27, 2007 at 10:34 UTC ( [id://641322]=perlquestion: print w/replies, xml ) | Need Help?? |
Scrat has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks I have an epoch start-date (1135202400) and an epoch end-date (1188252000). I'd like to loop through each day from start-date to end-date and perform an action for that day. Using a for loop, I tried to increment the number by 86400:
Which obviously didn't work and returned the message: Useless use of addition (+) in void context at...Then I tried this: Which returned: a value for each day, except for the first value which, if converted to date format, turns out to be the same day as that of the start-date value, just 2 hours later... I just need to loop through each day, from the start-date to the end-date, and when I convert the value back to date format the time must be displayed as 00:00:00 for each day, and not 02:00:00. Preferably I'd like to loop only once through each day to return a value, and not 86400 times. Thanks for any input / advice.
Back to
Seekers of Perl Wisdom
|
|