PHP strtotime() function wrong by 1 hour?

前端 未结 3 1348
难免孤独
难免孤独 2021-01-04 04:53

I am converting dates and times into timestamps using PHP before they are inserted into my MySQL database.

My problem is that when i use PHP\'s strtotime function th

3条回答
  •  感情败类
    2021-01-04 05:40

    Before PHP 5.3 the strtotime had problems calculating time if you added or deducted months and days etc. That was fixed so you now can tell specifically how you want it calculated, if you are below PHP 5.3 I would recommend doing the date calculating in mysql or upgrade your PHP version.

提交回复
热议问题