Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php如何设置时区(utc+;1 utc-5)而不是(欧洲/阿姆斯特丹…)_Php - Fatal编程技术网

php如何设置时区(utc+;1 utc-5)而不是(欧洲/阿姆斯特丹…)

php如何设置时区(utc+;1 utc-5)而不是(欧洲/阿姆斯特丹…),php,Php,我想显示世界上所有国家的日期和时间 问题是有40多个国家/地区使用utc+1 而且很难确定每个国家的具体时区 伦敦、摩洛哥和尼日尔的日期和时间相同 london => date_default_timezone_set('Europe/London'); morocco => date_default_timezone_set('Africa/Casablanca'); niger => date_default_timezone_set('Africa/Lagos'

我想显示世界上所有国家的日期和时间 问题是有40多个国家/地区使用utc+1 而且很难确定每个国家的具体时区 伦敦、摩洛哥和尼日尔的日期和时间相同

london =>  date_default_timezone_set('Europe/London');
 morocco =>  date_default_timezone_set('Africa/Casablanca');
 niger =>  date_default_timezone_set('Africa/Lagos');
我的第一个问题是为什么php不支持:

date_default_timezone_set('utc+1')
date_default_timezone_set('utc+2')

我如何使用utc+5或utc+2为所有国家定义一个时区你看了时区列表了吗?他们会做你想做的


你看过时区表了吗?他们会做你想做的


时区不仅仅是一个简单的UTC偏移量,考虑夏时制。@ UlrichEckhardt所以时区是自动支持夏令时的,或者我需要编辑MunalAlyTimeStand不仅仅是一个简单的UTC偏移,@ UlrichEckhardt时区是自动支持夏令时的,或者我需要手动编辑。
Etc/GMT+1   Etc/GMT+10  Etc/GMT+11  Etc/GMT+12
Etc/GMT+2   Etc/GMT+3   Etc/GMT+4   Etc/GMT+5
Etc/GMT+6   Etc/GMT+7   Etc/GMT+8   Etc/GMT+9
Etc/GMT-0   Etc/GMT-1   Etc/GMT-10  Etc/GMT-11
Etc/GMT-12  Etc/GMT-13  Etc/GMT-14  Etc/GMT-2
Etc/GMT-3   Etc/GMT-4   Etc/GMT-5   Etc/GMT-6
Etc/GMT-7   Etc/GMT-8   Etc/GMT-9   Etc/GMT0