Answer the question
In order to leave comments, you need to log in
Global time zone in Yii2?
I use DateControl I
came across an incomprehensible thing:
my time zone is +6 in the base is +3. when viewing the record, it normally shows (I display it through the helper). and when editing in DateControl shows +3 and it turns out that the date is a day ago. i.e. when saving the date looks like Jul 30, 2018 12:00:00 AM and when editing Jul 29, 2018 9:00:00 PM
the DateControl has 'displayTimezone' => 'Etc/GMT+6', and 'saveTimezone ' => 'Etc/GMT+6' but they don't react either.
Is it possible to somehow set the global timezone in yii, except for 'formatter' => ['timeZone' => 'Etc/GMT+6'] because is it being ignored?
ps The date is very important in a project.
Googled everything, it doesn't help.
Answer the question
In order to leave comments, you need to log in
in config
'timezone'=> 'UTC',
and set your timezone in the formatter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question