我需要将当前日期与开始日期进行比较,想法是每个月 + 1 天它会返回,好像只有一个月过去了。因此,如果开始日期是2014-10-27,则在2014-11-27仍将显示不到一个月前,而在2014-11-28将显示一个多月前。
目前我有:
$start_datetime = '2014-10-27';
// true if my_date is more than a month ago
if (strtotime($start_datetime) < strtotime('1 month ago')){
echo ("More than a month ago...");
} else {
echo ("Less than a month ago...");
}