Count down to EST Hour everyday?

2019-09-05 07:00发布

How would i count down to a specific hour every day, say 12PM EST time... So that it would countdown as 1 Hour 56 Minutes until 12PM / Lunch? I'm looking for something short and simple, no need for CSS or JS as it will be text and only update when the page is refreshed.

2条回答
老娘就宠你
2楼-- · 2019-09-05 07:19

I'm not sure if you have heard, but there's this trillion dollar site called google.com. You can search terms that will give you the best results on the web! Try it sometime, hella useful.

Check it out, here's the first result from it!

http://www.tripwiremagazine.com/2011/04/9-cool-jquery-countdown-scripts.html

查看更多
我命由我不由天
3楼-- · 2019-09-05 07:43

Here's what i was looking for in case it will help someone else.

function countdown($year, $month, $day, $hour, $minute)
{

$the_countdown_date = mktime($hour, $minute, 0, $month, $day, $year, -1);
$current = time();

$difference = $the_countdown_date - $current;
if ($difference < 0) $difference = 0;

$days = floor($difference/60/60/24);
$hours = floor(($difference - $days*60*60*24)/60/60);
$minutes = floor(($difference - $days*60*60*24 - $hours*60*60)/60);

echo "Checkback in ".$hours." hours and ".$minutes." minutes";
}

countdown(2016,1,1,12,0);
查看更多
登录 后发表回答