laravel 如何使用特定的UTC更改时区laravel 5.4版

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45113742/
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 16:18:00  来源:igfitidea点击:

How to change timezone laravel version 5.4 with specific UTC

phplaraveltimezone

提问by Ryan Aquino

how do you set your timezone to a specific GMT or UTC in the app.php on your laravel project

您如何在 Laravel 项目的 app.php 中将时区设置为特定的 GMT 或 UTC

回答by Qazi

It depends upon your requirements, Here is the list of supported time zones Supported Time ZonesSelect any region and see the list of zones name. Eg: I selected America which is America Time Zone

这取决于您的要求,这是支持的时区列表支持的时区选择任何区域并查看区域名称列表。例如:我选择了美国,这是美国时区

Eg: Laravel Default timezone is set like this,

例如:Laravel 默认时区是这样设置的,

'timezone' => 'UTC',

So you can pass your desire Timezone like this

所以你可以像这样传递你想要的时区

'timezone' => 'America/Los_Angeles',

Or

或者

'timezone' => 'America/Aruba',

回答by BENY

You can use this

你可以用这个

And edit your app.phpfile:

并编辑您的app.php文件:

'timezone' => 'UTC',