How to get different timezones' current time i

2020-05-06 11:56发布

问题:

Unfortunately I'm not using PHP 5. On the documentation of the date function it has a timezone section which lets you specify the difference from the GMT tome. How can you use that to get the current/local time in a specified timezone, and does it with with daylights savings?

回答1:

You can convert times to different timezones by using the PEAR Date package http://pear.php.net/package/Date

Examples here http://pear.php.net/manual/en/package.datetime.date.examples.php



标签: php timezone