in reply to Avoiding Datecalc

Well, I'm unclear on exactly what the rest of this is accomplishing, but, it is very likely when you were using the counter $i to figure out how far to "skip", you weren't converting that to/from seconds properly, or there were some other problems in the math in figuring out the resultant time.

I'm unable to get my brain to parse the code you have posted. Could you strip out the "playing with data" portions of the code, and just leave in the relavant portions of the date calculations? And post how you were trying to calculate the new time with $i? That should get us on track to be able to help you better.

-Scott