Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Time Countdown quozt msg:1299986 12:40 pm on Apr 12, 2004 (gmt 0) time is something ive never had to deal with in php but i wanted to do a small script for my site
the school day is split into somethign like 6 periods and lunch (but lunch is differnt for 2 groups) on the main page i wanted to show the time and what period it is for the two groups e.g.
Tuesday 14th March 12:49
Lower School - Lunch - 11 mins till Period 6 Sixth Form - Period 6 - 61 mins till End Of School
any ideas how this could be accomblished
Birdman msg:1299987 1:23 pm on Apr 12, 2004 (gmt 0)
Take a look at the date section [ php.net] in the PHP manual. It is very helpful.
aus_dave msg:1299988 12:32 am on Apr 13, 2004 (gmt 0)
At any point during the countdown you have a start time (i.e. now) and an end time.
A standard method is to work out the difference between the two times in seconds, and then work out how many multiples of 'whole' periods are in that difference (i.e. years, months, days etc.) where a minute is 60 seconds, an hour is 3600 and so on.
Do a search for 'PHP countdown scripts' on Google and you will find some useful code snippets ;).
WhosAWhata msg:1299989 2:14 am on Apr 14, 2004 (gmt 0)