Time Difference

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

Post Reply
bassett
Forum Newbie
Posts: 1
Joined: Fri Oct 14, 2005 6:55 am

Time Difference

Post by bassett »

Hi All,
Wondering if anyone can help, its probabily really simple but i just cant get my head round it.

Im currently working on a site which requires me to show how much time is left untill 7:30am each day, week, month and year

i.e.
-----------------------------------------------------------------------------------------------------------
Current DateTime(taken from server) -> End DateTime(7:30am every morning) -> DateTime Remaining
-----------------------------------------------------------------------------------------------------------
2005-10-14 20:00:00 -> 2005-10-15 07:30:00 -> 11hours 30minutes 0seconds //This is a daily countdown

2005-10-14 20:00:00 -> 2005-10-16 07:30:00 -> 1day 11hours 30minutes 0seconds ////Count to the end of the week

2005-10-14 20:00:00 -> 2005-11-01 07:30:00 -> 16days 11hours 30minutes 0seconds ////Count to the end of the month

2005-10-14 20:00:00 -> 2006-01-01 07:30:00 -> #days 11hours 30minutes 0seconds ////Count to the end of the year

Can anyone help?

Thanks
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

You need mktime
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

viewtopic.php?t=29341 may be of interest too
Post Reply