gpt4 book ai didi

php - 时间介于其他两个时间之间吗?

转载 作者:可可西里 更新时间:2023-11-01 12:26:14 24 4
gpt4 key购买 nike

我想做的(例如)是在每周三晚上 8:00 到凌晨 2:00 之间更改我网站的 Logo 。从技术上讲,凌晨 2:00 是星期四早上。那么我如何检查当前时间是否在星期三晚上 8:00 到凌晨 2:00 之间?

最佳答案

嗯,更简单:

$current_time = strtotime('now');
if ($current_time > strtotime('wednesday this week 8:00pm') && $current_time < strtotime('thursday this week 2:00am')) {
// Special logo
}

关于php - 时间介于其他两个时间之间吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5413505/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com