当前位置:网站首页>Timestamp strtotime the day before or after the date

Timestamp strtotime the day before or after the date

2022-07-05 16:49:00 withkai44

date_default_timezone_set(‘PRC’); // Default time zone

today : date("Y-m-d", time())

yesterday : date("Y-m-d", strtotime("-1 day"))

Tomorrow, : date("Y-m-d", strtotime("+1 day"))

5 Days later : date('Y-m-d', strtotime("+5 day"))

A week later : date("Y-m-d", strtotime("+1 week"))

Two days a week, four hours and two seconds later : date("Y-m-d G:H:s", strtotime("+1 week 2 days 4 hours 2 seconds"))

Next Thursday : date("Y-m-d", strtotime("next Thursday"))

Last Monday : date("Y-m-d", strtotime("last Monday"))

A month ago : date("Y-m-d", strtotime("last month"))

A month ago : date("Y-m-d", strtotime("-1 month"))

After a month : date("Y-m-d", strtotime("+1 month"))

原网站

版权声明
本文为[withkai44]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051611299230.html