还是加个全局中间件
public function handle($request, Closure $next)
{
// ...
date_default_timezone_set(env(‘TIMEZONE‘, ‘UTC‘));
return $next($request);
}
不要忘了在bootstrap/app.php里注册
.env文件里添加
TIMEZONE=Asia/Shanghai
原文:http://www.cnblogs.com/zergling9999/p/7392511.html