Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以这种格式写入的时间与当前时间进行比较,以查看该确切时刻是否已经发生(用于倒数计时器),但时间必须采用以下格式:
12/31/2012 5:00 AM UTC-0500
最后我想说如果当前时间小于那个日期,显示这个,否则,显示这个。
strtotime can convert string dates to unix timestamp which you can easily use later for comparisons/etc
$timestamp = strtotime("12/31/2012 5:00 AM UTC-0500"); if (time() > $timestamp) ...