检查时间戳是否是今天

2022-01-13 00:00:00 timestamp date php

我有一个以下格式的时间戳(由于 PHP 的优点可以轻松更改!).

I've got a timestamp in the following format (Which can easily be changed thanks to the beauties of PHP!).

2011-02-12 14:44:00

2011-02-12 14:44:00

检查这个时间戳是否是今天拍摄的最快/最简单的方法是什么?

What is the quickest/simplest way to check if this timestamp was taken today?

推荐答案

我认为:

date('Ymd') == date('Ymd', strtotime($timestamp))

相关文章