Support other local date format for timezone detection to avoid startup errors

fixes PocketMine/PocketMine-MP#718
This commit is contained in:
JWhy 2013-10-21 06:12:27 +02:00
parent 9ac72026b9
commit a860f16f4a

View File

@ -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);