比较日期并了解天气第一个日期大于第二个日期


Compare Dates and find out weather First date is greater from second

Date1=23-3-2013

日期2=2013年3月26日

如何比较以上两个日期如果Date2>=Date1回声越大,等于

其他

回声不大于

在这里,更大并不意味着数学上的更大

使用函数strtotime($date)因此,你会有这样的东西:

if(strtotime($date1) < strtotime($date2)){
    echo Date 2 is greater than date 1;
}else{
    echo Date 1 is greater or equal than Date 2;
 }