dminder Posted May 12, 2010 Share Posted May 12, 2010 First, let me say that I am still a noob, but am learning quite a bit. I am trying to display a countdown to midnight on my php page. I keep trying to use a combination of time() and mktime() and it just is not working.....HELP!!! Thanks,D Link to comment Share on other sites More sharing options...
thescientist Posted May 12, 2010 Share Posted May 12, 2010 what's your code? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 12, 2010 Share Posted May 12, 2010 If you want the timer to actually count down on the page you need to use Javascript to animate that. If you just want to display the time until midnight whenever the page got loaded, you can do that with only PHP. You can use mktime to get the timestamp for midnight, time to get the current timestamp, subtract them to get the number of seconds until midnight, and then just divide the number of seconds to get hours and minutes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.