问题
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.
回答1:
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
回答2:
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);
来源:https://stackoverflow.com/questions/5953065/count-down-to-est-hour-everyday