Store php datetime in mysql database

前端 未结 6 479
迷失自我
迷失自我 2020-12-09 03:38

I can\'t believe I can\'t do this, but I want to be able to store the current date and time from php in to a mysql table.

The column in the table is type datetime. I

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 04:09

    Don't save it as the Unix Timestamp (which strtotime() outputs), but as "2012-12-02 13:00" into the DATETIME column.

提交回复
热议问题