Skip to content

Commit cddf9a4

Browse files
committed
fix: 修复时区错误
1 parent 47024cf commit cddf9a4

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

FileStorage/app/Utilities/FileUtility.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public static function getFileStorageDriver()
2424

2525
public static function initTimezone()
2626
{
27-
$timezone = Config::getValueByKey('file_storage_timezone') ?? 'PRC';
28-
29-
date_default_timezone_set($timezone);
27+
$timezone = Config::getValueByKey('file_storage_timezone');
28+
if ($timezone) {
29+
date_default_timezone_set($timezone);
30+
}
3031
}
3132

3233
public static function initConfig()

FileStorage/database/migrations/init_file_storage_config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'item_tag' => 'file_storage',
3333
'item_key' => 'file_storage_timezone',
3434
'item_type' => 'string',
35-
'item_value' => 'PRC',
35+
'item_value' => 'Asia/Shanghai',
3636
],
3737
[
3838
'item_tag' => 'file_storage',

0 commit comments

Comments
 (0)