|
@ -3,7 +3,7 @@ namespace p3k; |
|
|
|
|
|
|
|
|
class Timezone { |
|
|
class Timezone { |
|
|
|
|
|
|
|
|
public static function timezone_for_location($lat, $lng) { |
|
|
|
|
|
|
|
|
public static function timezone_for_location($lat, $lng, $date=false) { |
|
|
$start = microtime(true); |
|
|
$start = microtime(true); |
|
|
|
|
|
|
|
|
$tzfile = self::tz_data(); |
|
|
$tzfile = self::tz_data(); |
|
@ -31,7 +31,7 @@ class Timezone { |
|
|
// echo "Sorted in " . ((microtime(true)-$start)*1000). "ms\n";
|
|
|
// echo "Sorted in " . ((microtime(true)-$start)*1000). "ms\n";
|
|
|
|
|
|
|
|
|
if(count($timezones) > 0) |
|
|
if(count($timezones) > 0) |
|
|
return new timezone\Result($timezones[0][2]); |
|
|
|
|
|
|
|
|
return new timezone\Result($timezones[0][2], $date); |
|
|
else |
|
|
else |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|