我正在 config/app.php 处将时区更改为 Asia/Singapore,但是当我尝试执行 date("Ymd H:i:s"); 结果仍然是UTC.
I am changing the timezone into Asia/Singapore at config/app.php, but when I try to do a date("Y-m-d H:i:s"); the result is still in UTC.
Laravel 中是否有任何内容可以覆盖我在 config/app.php 中设置的时区?
Is there anything in Laravel that overrides that timezone that I set at config/app.php ?
只需这样做:
'timezone' =>'亚洲/新加坡'
在 config/app.php 文件中并运行这 3 个命令:
in config/app.php file and run this 3 command:
php artisan cache:clear
php artisan view:clear 和
php artisan config:cache
希望对你有帮助!!
这篇关于Laravel 更改时区未反映正确时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Laravel Eloquent Union 查询Laravel Eloquent Union query(Laravel Eloquent Union 查询)
覆盖 Laravel 5 辅助函数Overwrite laravel 5 helper function(覆盖 Laravel 5 辅助函数)
laravel querybuilder 如何在 where 函数中使用 likelaravel querybuilder how to use like in wherein function(laravel querybuilder 如何在 where 函数中使用 like)
响应内容必须是实现 __toString()、“boolean"和“The Response content must be a string or object implementing __toString(), quot;booleanquot; given after move to psql(响应内容必须是实现 __toS
Laravel 5 的角色,如何只允许管理员访问某些根Roles with laravel 5, how to allow only admin access to some root(Laravel 5 的角色,如何只允许管理员访问某些根)
Laravel Auth - 使用 md5 而不是集成的 Hash::make()Laravel Auth - use md5 instead of the integrated Hash::make()(Laravel Auth - 使用 md5 而不是集成的 Hash::make())