How to convert between time zones in PHP using the DateTime class?

后端 未结 3 1983
北海茫月
北海茫月 2020-12-02 22:13

I am trying to convert time between current time to UTC and UTC to current time zone.

Here is what I have done:

$schedule_date = new DateTime($trigge         


        
3条回答
  •  借酒劲吻你
    2020-12-02 22:58

    Create the date using the local timezone, then call DateTime::setTimeZone() to change it.

提交回复
热议问题