Where to set local timestamp time on global


Could you please tell me how to setup the global timezone in Yii2 so the now() time uses the server time.

Thank you,


In config:

         // This set PHP DateTime to UTC

         'timeZone' => 'UTC',

         // This set DB timezone to UTC

        'db' => [

            'class' => 'yii\db\Connection',

            'dsn' => 'mysql:host=localhost;dbname=zzzzzzz',

            'username' => 'xxxxx',

            'password' => 'yyyyy',

            'charset' => 'utf8',


			'on afterOpen' => function($event) {

				$event->sender->createCommand("SET time_zone = '+00:00'")->execute();