Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-llLocateTimezone

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  llLocateTimezone   Lines 303-337 (34 lines) file  utilsCoords.php   Last mod: Tue 2021-04-06 21:34:28

function llLocateTimezone $lat$long$tzInfo$ctry='' )
        {
#-k     geo
#-       given lat & long, find the tz from the global tzInfo array
#-              (loaded from JSON array in 'timezoneData.js')
        
$d 9999999;

        foreach (
$tzInfo as $key => $tz)
                {
                if (
strlen($ctry))
                        {
                        if (
$tz['cc'] == $ctry)
                                {
                                
$dist[$key] = llDistance $lat$long$tz['lat'], $tz['lon'] );
                                if (
$dist[$key] < $d)
                                        {
                                        
$d $dist[$key];
                                        
$dk $key;
                                        }
                                }
                        }
                else
                        {
                        
$dist[$key] = llDistance $lat$long$tz['lat'], $tz['lon'] );
                        if (
$dist[$key] < $d)
                                {
                                
$d $dist[$key];
                                
$dk $key;
                                }
                        }
                }

        return 
$dk;
        }

?>