laravel 设置新西兰的时区

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37934952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 14:02:29  来源:igfitidea点击:

Set timezone for New Zealand

phplaravellaravel-5.2

提问by Paul Lucero

I'm currently developing a website using Laravel. I would like to change the timezone to New Zealand since it will be used there.

我目前正在使用 Laravel 开发一个网站。我想将时区更改为新西兰,因为它将在那里使用。

'timezone' => 'NZ',

I currently have that in my config/app.php and it returns the correct time but wrong am/pm. E.g time returned is 3:03 am, but correct time in new zealand is 3:03 pm.

我目前在我的 config/app.php 中有它,它返回正确的时间但错误的 am/pm。例如,返回的时间是凌晨 3:03,但新西兰的正确时间是下午 3:03。

回答by

valid timezone for php can bee found here: List of Supported Timezones

可以在此处找到 php 的有效时区:支持的时区列表

In your case you need NZ so its Pacific/Auckland

在你的情况下,你需要新西兰,所以它的太平洋/奥克兰

Why its Auckland and not the capital Wellington i have no idea.

为什么是奥克兰而不是首都惠灵顿,我不知道。