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'
        ]
    ]
];

posted on 2018-02-01 10:08  跳动的汗水  阅读(209)  评论(0编辑  收藏  举报

导航