且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在PHP中比较两个日期?

更新时间:2022-11-17 14:54:18

数据库中的日期如下所示:2011-10-2

in the database the date looks like this 2011-10-2

将其存储在YYYY-MM-DD中,然后进行字符串比较,因为'1'>'0'等.

Store it in YYYY-MM-DD and then string comparison will work because '1' > '0', etc.