php - How to format Beijing time into 2012-08-24T14:02:15-04:00
代言
代言 2017-06-29 10:08:52
0
2
1033

Currently we only know that DATE_ATOM formatted into UTC is 2012-08-24T14:02:15 00:00. How can the latter offset be generated through a function? ? ? ?

代言
代言

reply all(2)
小葫芦

The last -04:00 is the offset between the current time zone and the UTC standard time zone.

If you set the time zone (such as Beijing), then the offset (+08:00) East Eighth District

date("P"); // 显示时区偏移量

Your -04:00 indicates that the time zone set is -04:00 (West 4th District)

三叔

Excerpted from PHP documentation:
http://php.net/manual/en/func...

You can use date('O') or date('P'), depending on what format you need.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template