更新时间:2023-12-01 12:06:58
尝试使用这样的东西:
if(strtotime('2011-08-19 17:14:40') < strtotime('-30 days')) {
// this is true
}
此外,这个字符串看起来像在SQL中存储为datetime /时间戳字段。您可以使用以下方式直接从您的数据库中选择所有条目:
Besides, this string looks like it is stored in SQL as datetime/timestamp field. You can directly select all entries from your database with old dates using:
SELECT ... WHERE `datetime` + INTERVAL 30 DAY < NOW()