A new plugin is now available for showing current time for various places around the world.
Main features:
– current time for many locations all around the world
– sun rise / sun set times
– day length / night length
– interactive timezone map
In this plugin you can view current time as well as times for sun rise, sun set, day length, night length etc. for many places around the world. There are already built-in data sets, but you can easily add your own city just by specifying its name, geographical coordinates and timezone. The display also shows you whether it is day or night by the color of the background.
In addition there is also an interactive timezone map, where you can click any place to view timezone in that location.
Installation:
– download the files and extract
– open index.php in a text editor and specify the default data set you want to be loaded and also whether you want to use the 24h or the 12h (AM/PM) time format.
– save changes and close
– upload all files to your plugins directory
– add link to the menu
Adding custom locations:
If you want to add custom location then open the file data.php in a text editor.
Then create your new data set as follows:
if($region==”datasetName”){
$locations [] = array(‘Name’,latitude,longitude,’timezone’,’ISO-2 country code’);
$locations [] = array(‘Name’,latitude,longitude,’timezone’,’ISO-2 country code’);
…..
}
In the above code, for each location you must specify a name, latitude, longitude, timezone and the country ISO-2 code.
Then save the changes and close.
Now open index.php and add the name of your newly created dataset to the array of available locations at the top like this:
$locations [] = array(“datasetName”,”Data set label”);
For datasetName you must specify the name you gave to the newly created data set in data.php. Data set label is the text displayed in the select box to the user.
Save and close.
Nicely done Jachym. I have easily modified the array to include the Canadian Provinces which span from 47.56494/-52.70931 to 60.72118/-135.05683 and 6 time zones.
Paul