PHP date_default_timezone_set() Eastern Standard Time (EST)

后端 未结 5 700
梦谈多话
梦谈多话 2020-12-17 16:48

Long story short

Is there an official, un-deprecated timezone that PHP5 recognizes for Eastern STANDARD time--not Eastern DAYLIGHT time?

5条回答
  •  天命终不由人
    2020-12-17 17:30

    Well, if you really want X hours before or after a UTC date, I would do this:

    $now = gmdate('Y-m-d H:i:s', time() - 3600 * $hours);
    

    In your case, $hours would be 5, I think.

    As others have suggested, myself included, this is not good practice... But you are aware of that.

提交回复
热议问题