PHP date() function not giving correct time

前端 未结 4 1629
清酒与你
清酒与你 2021-01-25 04:34

I am trying to figure out why php date() is giving me the wrong time, setting the actual time back 2 hours.


4条回答
  •  温柔的废话
    2021-01-25 05:16

    Try setting the the timezone: date_default_timezone_set or via the ini

    Update: you cannot set the correct date for your users. Javascript can handle it but you'd have to rely on the user's system to determine his/her time.

提交回复
热议问题