How to get different timezones' current time in PHP?

时光毁灭记忆、已成空白 提交于 2019-12-20 06:08:24

问题


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



来源:https://stackoverflow.com/questions/634210/how-to-get-different-timezones-current-time-in-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!