Would anyone know how to loop through dates and increment seconds?
For example, I have a start date/time stamp of 2010-15-07 15:10:30
I'd like to loop through this say 10 times each time adding 30 seconds to the second value.
Thanks!
Loop through Dates and Times
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Loop through Dates and Times
If all you want to do is add 30 seconds to a date/time that you have a timestamp for (i.e. from the strtotime() function), you could just add 30 to the timestamp. The timestamp is the number of seconds since the Unix Epoch.
Otherwise, the mktime() function may prove useful.
Otherwise, the mktime() function may prove useful.