Page 1 of 1

calculate time between two dates + times

Posted: Mon Feb 26, 2007 10:11 am
by benyboi
This may be too much to ask for, but I would like someone to tell me or point me in the right direction for the following:

I need a script to work out the time between two dates.

E.G. the time and days between now and say next sunday at 11AM.

Thanks

Posted: Mon Feb 26, 2007 10:24 am
by feyd
2 × strtotime(). Find the difference.. that's how long it is in seconds.

You can convert that back to useful units via a script printf (that's the username, not the function) posted in Code Snippets a good long time ago.