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.
我正在尝试做这样的事情:
如果“结束日期”在过去 30 天内,请执行此操作。如果没有,请执行此操作。
我将如何在 php 中编写它?
假设您将“结束日期”作为 unix 时间戳,我会尝试以下操作:
$month = 60 * 60 * 24 * 30; // month in seconds if (time() - $closingTime < $month) { // within the last 30 days ... } else { // the closing date it longer ago ... }