Yii2.0怎么设置时区?
在config
文件夹下,main.php 中,
return [
'charset' => 'utf-8',
'language' => 'zh-CN',
'timeZone' => 'Asia/Shanghai',
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache'
],
'formatter' => [
'dateFormat' => 'yyyy-MM-dd',
'timeFormat' => 'HH:mm:ss',
'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss'
]
]
];