mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 15:49:54 +00:00
Merge pull request #880 from JWhy/patch-1
Support other local date format for timezone detection to avoid startup errors
This commit is contained in:
commit
70ec644658
@ -28,7 +28,7 @@ if(strpos(" ".strtoupper(php_uname("s")), " WIN") !== false){
|
||||
exec("time.exe /T", $hour);
|
||||
$i = array_map("intval", explode(":", trim($hour[0])));
|
||||
exec("date.exe /T", $date);
|
||||
$j = array_map("intval", explode("/", trim($date[0])));
|
||||
$j = array_map("intval", explode(substr($date[0], 2, 1), trim($date[0])));
|
||||
$offset = round((mktime($i[0], $i[1], 0, $j[1], $j[0], $j[2]) - $time) / 60) * 60;
|
||||
}else{
|
||||
exec("date +%s", $t);
|
||||
|
Loading…
x
Reference in New Issue
Block a user