HCProfessionals Posted February 27, 2011 Share Posted February 27, 2011 I would like to have this done in php but am about to lose my mind. Just need a script to countdown to midnight, server time. Doesn't have to be live, just something to see when the page is reloaded. Any help would be much aprreciated Quote Link to comment Share on other sites More sharing options...
Fergal Andrews Posted February 27, 2011 Share Posted February 27, 2011 Hi HCProfessionals, This will give you the time difference in minutes. Note that midnight date is 28, not 27 which is today's date as it is midnight tomorrow morning (if that makes sense!). <?php $currentTime = date("Y-m-d h:i:s"); $midnight = strtotime("2011-02-28 00:00:00"); $now = strtotime($currentTime); echo round (abs ($midnight - $now) / 60,2)." minutes"; ?> Cheers, Fergal Quote Link to comment Share on other sites More sharing options...
RussellReal Posted February 27, 2011 Share Posted February 27, 2011 if you want this INTERACTIVE you'd need to incorporate some javascript Quote Link to comment Share on other sites More sharing options...
HCProfessionals Posted February 27, 2011 Author Share Posted February 27, 2011 You guys are amazing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.