I might be overlooking something obvious, if so I apologise in advance.
I have a partial in my backend form with the following code:
<?= $formModel->roomOrderLine->start_time->format('l d. F Y') ?>
I’ve confirmed that the object is an Argon instance. But trying to manually force a timezone on the object like this does nothing.
<?= $formModel->roomOrderLine->start_time->tz('Europe/Oslo')->format('l d. F Y') ?>
The backend timezone for my current user is set to ‘Europe/Oslo’. All fields are stored as UTC in the DB with the app generally using Carbon toIso8601ZuluString as I’m also interfacing with Office365 calendars and external payment providers.
I have no issues with Carbon adhering to the right timezone in the frontend.
my config/app.php has this:
'timezone' => 'UTC',
my config/cms.php has this:
'timezone' => 'Europe/Oslo',
I’ve also tried forcing the backend timezone in config/backend.php to ‘Europe/Oslo’ but it seems to me the backend date settings are completely ignored.
My models in the backend are consistently ignoring timezone settings on all fields and in code as shown above. What could be the cause of this? It’s really just messing with my app since I cannot deliver it to a client in it’s current state. What am I missing?