php and mysql date time difference

前端 未结 4 737
轮回少年
轮回少年 2021-01-24 15:20

I did this in php to store the lastlogin in a mysql datetime column

date(\'Y-m-d h:i:s\') //which then gave > \'2014-01-04 08:00:56\'

and th

4条回答
  •  遇见更好的自我
    2021-01-24 15:43

    Like Filip said it's probably a timezone issue; you can change the timezone of your script to whatever timezone your MySQL is set to like this:

    date_default_timezone_set('America/Los_Angeles');
    

提交回复
热议问题