Jump to content

Countdown to midnight?


Carbon

Recommended Posts

use strtotime('12am') to get the unix timestamp for midnight, then minus the current from that

$midnight = strtotime('12am');
$current=time();
$count=$midnight-$current;

//convert seconds to hours etc

have a look at this function to convert seconds to hours

http://www.laughing-buddha.net/php/lib/sec2hms/

use strtotime('12am') to get the unix timestamp for midnight, then minus the current from that

$midnight = strtotime('12am');
$current=time();
$count=$midnight-$current;

//convert seconds to hours etc

have a look at this function to convert seconds to hours

http://www.laughing-buddha.net/php/lib/sec2hms/

 

Thanks :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.