I am using Lumen framework. How can I change Timezone to Europe/Paris CEST?
I added a varaible in my .env file:
APP_TIMEZONE=Europe/Pari
In my case (reading a date from a MySQL db in a Lumen 5.1 project) the only solution that worked is using Carbon to set timezone of variables:
$carbonDate = new Carbon($dateFromDBInUTC);
$carbonDate->timezone = 'America/New_York';
return $carbonDate->toDayDateTimeString(); // or $carbonDate->toDateTimeString() for ISO format
Using DB_TIMEZONE=-05:00 in the .env file almost worked but does not handle DST changes.
Using the APP_TIMEZONE=America/New_York in the .env file had no effect on a timezone value retrieved in a Lumen 5.1 webapp from a MySQL database, but it works in Lavarel 5.1.
Also Lumen didn't read at all the [lumen_project]/config/app.php file that I created (it didn't complain when I put a syntax error there).
Using date_default_timezone_set didn't work either.