Is there a way to display all the date times with a global timezone and that would not affect them being saved in UTC. Can’t seem to see a setDefaultOutputTimezone() function, though it’s mentioned in the repo a while back.
Would be very handy as I can only see that I have to use the i18nFormat() function for each date that I want to show ajusted…
// You should change this to UTC
date_default_timezone_set('America/Argentina/Buenos_Aires');
$defaultLocale = Configure::read('App.defaultLocale');
ini_set('intl.default_locale', $defaultLocale);
Cake\I18n\Time::setDefaultLocale($defaultLocale); // For any mutable DateTime
Cake\I18n\FrozenTime::setDefaultLocale($defaultLocale); // For any immutable DateTime
Cake\I18n\Date::setDefaultLocale($defaultLocale); // For any mutable Date
Cake\I18n\FrozenDate::setDefaultLocale($defaultLocale); // For any immutable Date
And set defaultLocale (in app) AND timezone(in datasources) in your app.php
Cake\I18n\Time::setDefaultLocale($defaultLocale); // For any mutable
DateTime
Cake\I18n\FrozenTime::setDefaultLocale($defaultLocale); // For any
immutable DateTime
Cake\I18n\Date::setDefaultLocale($defaultLocale); // For any mutable Date
Cake\I18n\FrozenDate::setDefaultLocale($defaultLocale); // For any
immutable Date
The note was created at 10:34 UK time. The output of the date doesn’t seem
to account for day light savings time. Though I believe that the date has
been stored correctly in UTC
Can you offer any further advice? You help is very much appreciated.