Get current date, given a timezone in PHP?

前端 未结 5 1501
灰色年华
灰色年华 2020-12-04 13:32

I want to get todays date given a time zone in Paul Eggert format(America/New_York) in PHP?

5条回答
  •  渐次进展
    2020-12-04 13:50

    Set the default time zone first and get the date then, the date will be in the time zone you specify :

    
    

    http://php.net/manual/en/function.date-default-timezone-set.php

提交回复
热议问题