Is there an easy way to save the date and time in UTC, but when do you display the dates and times to convert them to specific time zones? I added
'formatter' => [
'class' => 'yii\i18n\Formatter',
'timeZone' => 'America/New York',
],
In my configuration, but everything is now saved, as in the EST time zone in the database. I want the database to always be UTC and control the time zone display when printing time and date in php.
Basically, I would like to formatterhave a separate parameter for controlling the format included in the database, and another parameter for controlling the format for display purposes (since users can be in different time zones).
source
share