This is an example of how to do this if the time zone is stored as a row in the timezone column in the users table. Add this to your application configuration:
'on beforeRequest' => function () { $user = Yii::$app->user->identity; if ($user && $user->timezone) { Yii::$app->setTimeZone($user->timezone); } },
This code is run before the request and sets the time zone depending on the specific user. Of course, you can move it to a separate class and call it here.
Official documents:
source share