PHP: strtotime is returning false for a future date?

前端 未结 5 1826
南方客
南方客 2020-11-29 11:40

here are some debug expressions i put into eclipse, if you don\'t believe me:

\"strtotime(\"2110-07-16 10:07:47\")\" = (boolean) false    
\"strtotime(\"2110         


        
5条回答
  •  悲&欢浪女
    2020-11-29 12:05

    Simple replacement of strtotime

    $date = '2199-12-31T08:00:00.000-06:00';
    
    echo date('Y-m-d', strtotime($date)); // fails with 1970 result
    
    echo date_format(  date_create($date) , 'Y-m-d'); // works perfect with 5.2+
    

    Actual post here.

提交回复
热议问题