每天倒计时 EST 时间?

发布于 2024-11-05 21:38:35 字数 117 浏览 0 评论 0原文

我如何倒计时到每天的特定时间,例如美国东部时间中午 12 点...以便倒计时为 1 小时 56 分钟,直到中午 12 点/午餐?我正在寻找一些简短的内容,不需要 CSS 或 JS,因为它将是文本,并且仅在刷新页面时更新。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淤浪 2024-11-12 21:38:35

我不确定您是否听说过,有一个价值数万亿美元的网站,名为 google.com。您可以搜索将为您提供网络上最佳结果的字词!有时间试试,很有用。

检查一下,这是第一个结果!

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

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

三生路 2024-11-12 21:38:35

这就是我一直在寻找的内容,以防对其他人有所帮助。

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);

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文