I did not find any relevant information (only tricks) about how to set the default timezone in Lumen 5.2. Is there any clean way to do this?
/** * Create a new Lumen application instance. * * @param string|null $basePath * @return void */ public function __construct($basePath = null) { ... date_default_timezone_set(env('APP_TIMEZONE', 'UTC')); ... We see that Lumen will not take any config value, just an env value to set the time zone.
In the laravel project open the file config/app. php , you will notice the 'timezone' => 'UTC', by default, timezone is set to UTC.
In Lumen 5.2 the Application class actually reads from a APP_TIMEZONE environment variable.
You can easily set timezone via a .env file using or setting the environment variable on your server:
APP_TIMEZONE=UTC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With