Home > PHP Framework > Laravel > How to set time zone in laravel5

How to set time zone in laravel5

青灯夜游
Release: 2023-01-13 00:40:29
Original
3377 people have browsed it

How to set the time zone in laravel: 1. Open the "/config/app.php" file under the project; 2. In "app.php", look for the "'timezone' =>" item and change The value of this item is set to the required time zone identifier, such as "Asia/Shanghai" or "PRC".

How to set time zone in laravel5

The operating environment of this tutorial: Windows 7 system, Laravel version 5, Dell G3 computer.

How to set time zone in laravel

Laravel’s time zone is the same as PHP’s time zone. You can go to http://php.net/manual/zh/timezones.php to find the time zone identifier you need.

Go to /config/app.php under the project and find

'timezone' => 'UTC',
Copy after login

utc to modify the time zone identifier you need (that is, at http://php.net/manual/ zh/timezones.php found)

For example, in China, change it to

'timezone' => 'Asia/Shanghai',
Copy after login

or

'timezone' => 'PRC',
Copy after login

Related recommendations: The latest five Laravel videos Tutorial

The above is the detailed content of How to set time zone in laravel5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template