yii2时区设置

main.php

return [
    'charset' => 'utf-8',
    'language' => 'zh-CN',
    'timeZone' => 'Asia/Shanghai',
    'components' => ['formatter' => [
            'dateFormat' => 'yyyy-MM-dd',
            'timeFormat' => 'HH:mm:ss',
            'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss'
        ]
    ]
];

 

posted @ 2018-06-30 11:35  maoriaty  阅读(1804)  评论(0编辑  收藏  举报