PHP strtotime returns a 1970 date when date column is null

后端 未结 4 2025
我在风中等你
我在风中等你 2020-12-03 15:04

I want to display $row->depositdate in dd-mm-yyyy format.

If the date column in database is null the date displayed is : 01-01-1970

         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 15:31

    Oh! I know why this happens? Simply you have not included "depositdate" in your SELECT query. Firstly Change SQL query to select all with wild card sign as shown here

    $sql = "SELECT * FROM `yourtable`";
    

提交回复
热议问题