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.
日期 1=23-3-2013
日期 2=26-3-2013
如何比较以上两个日期,例如 If Date2 >= Date1 Echo 大于等于
别的
回声不大于它们等于
这里更大并不意味着在数学上更大
使用函数strtotime($date) 因此,你会得到类似的东西:
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; }