timezone 3.5

pull/578/head
qkqpttgf 2020-04-05 14:32:23 +08:00 committed by GitHub
parent e9743c648f
commit 52afcecb0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 35 deletions

View File

@ -108,6 +108,40 @@ $ShowedInnerEnv = [
//'token_expires', //'token_expires',
]; ];
$timezones = array(
'-12'=>'Pacific/Kwajalein',
'-11'=>'Pacific/Samoa',
'-10'=>'Pacific/Honolulu',
'-9'=>'America/Anchorage',
'-8'=>'America/Los_Angeles',
'-7'=>'America/Denver',
'-6'=>'America/Mexico_City',
'-5'=>'America/New_York',
'-4'=>'America/Caracas',
'-3.5'=>'America/St_Johns',
'-3'=>'America/Argentina/Buenos_Aires',
'-2'=>'America/Noronha',
'-1'=>'Atlantic/Azores',
'0'=>'UTC',
'1'=>'Europe/Paris',
'2'=>'Europe/Helsinki',
'3'=>'Europe/Moscow',
'3.5'=>'Asia/Tehran',
'4'=>'Asia/Baku',
'4.5'=>'Asia/Kabul',
'5'=>'Asia/Karachi',
'5.5'=>'Asia/Calcutta', //Asia/Colombo
'6'=>'Asia/Dhaka',
'6.5'=>'Asia/Rangoon',
'7'=>'Asia/Bangkok',
'8'=>'Asia/Shanghai',
'9'=>'Asia/Tokyo',
'9.5'=>'Australia/Darwin',
'10'=>'Pacific/Guam',
'11'=>'Asia/Magadan',
'12'=>'Asia/Kamchatka'
);
function main($path) function main($path)
{ {
global $exts; global $exts;
@ -616,39 +650,7 @@ function gethiddenpass($path,$passfile)
function get_timezone($timezone = '8') function get_timezone($timezone = '8')
{ {
$timezones = array( global $timezones;
'-12'=>'Pacific/Kwajalein',
'-11'=>'Pacific/Samoa',
'-10'=>'Pacific/Honolulu',
'-9'=>'America/Anchorage',
'-8'=>'America/Los_Angeles',
'-7'=>'America/Denver',
'-6'=>'America/Mexico_City',
'-5'=>'America/New_York',
'-4'=>'America/Caracas',
'-3.5'=>'America/St_Johns',
'-3'=>'America/Argentina/Buenos_Aires',
'-2'=>'America/Noronha',
'-1'=>'Atlantic/Azores',
'0'=>'UTC',
'1'=>'Europe/Paris',
'2'=>'Europe/Helsinki',
'3'=>'Europe/Moscow',
'3.5'=>'Asia/Tehran',
'4'=>'Asia/Baku',
'4.5'=>'Asia/Kabul',
'5'=>'Asia/Karachi',
'5.5'=>'Asia/Calcutta', //Asia/Colombo
'6'=>'Asia/Dhaka',
'6.5'=>'Asia/Rangoon',
'7'=>'Asia/Bangkok',
'8'=>'Asia/Shanghai',
'9'=>'Asia/Tokyo',
'9.5'=>'Australia/Darwin',
'10'=>'Pacific/Guam',
'11'=>'Asia/Magadan',
'12'=>'Asia/Kamchatka'
);
if ($timezone=='') $timezone = '8'; if ($timezone=='') $timezone = '8';
return $timezones[$timezone]; return $timezones[$timezone];
} }
@ -1488,6 +1490,7 @@ function EnvOpt($needUpdate = 0)
global $constStr; global $constStr;
global $ShowedCommonEnv; global $ShowedCommonEnv;
global $ShowedInnerEnv; global $ShowedInnerEnv;
global $timezones;
asort($ShowedCommonEnv); asort($ShowedCommonEnv);
asort($ShowedInnerEnv); asort($ShowedInnerEnv);
$html = '<title>OneManager '.getconstStr('Setup').'</title>'; $html = '<title>OneManager '.getconstStr('Setup').'</title>';
@ -1556,9 +1559,9 @@ function EnvOpt($needUpdate = 0)
<td><label>' . $key . '</label></td> <td><label>' . $key . '</label></td>
<td width=100%> <td width=100%>
<select name="' . $key .'">'; <select name="' . $key .'">';
for ($i=-12;$i<13;$i++) { foreach (array_keys($timezones) as $zone) {
$html .= ' $html .= '
<option value="'.$i.'" '.($i==getConfig($key)?'selected="selected"':'').'>'.$i.'</option>'; <option value="'.$zone.'" '.($zone==getConfig($key)?'selected="selected"':'').'>'.$zone.'</option>';
} }
$html .= ' $html .= '
</select> </select>