PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
benyboi
Forum Commoner
Posts: 80 Joined: Sat Feb 24, 2007 5:37 am
Post
by benyboi » Mon Feb 26, 2007 10:11 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 26, 2007 10:24 am
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.