comparing date and time php

前端 未结 2 1542
说谎
说谎 2021-01-21 09:16

i need to compare two dates where if one date is greater than the other then an sql will run. this is my code

date_default_timezone_set(\'Asia/Kuala_Lumpur\');
$         


        
2条回答
  •  执笔经年
    2021-01-21 09:34

    could you try and use the date format before using strtotime

    $duedate = $row['payment_due'];
    $duedate = $duedate->format('Y-m-d G:i:s');
    

提交回复
热议问题