1. Upload this file to your web directory: WorldTimeClock.class.
2. Add the following code to your web page:
<APPLET CODE="WorldTimeClock.class" CODEBASE="my directory" WIDTH="710" HEIGHT="170">
</APPLET>
Replace my directory by the directory, where you have the file of step 1 or remove the whole CODEBASE="my directory" if it's in the same directory as your web page. Later you will have to adjust the width and the height of the applet depending on your settings.
3. Add a new line before the </APPLET> tag and enter the following code:
<PARAM NAME="name" VALUE="value">
Now replace name by the name of the parameter you want to change and value by the value you want to change it to from the table below.
4. Repeat step 3 for all the parameters you want to change. Note
that every parameter has a default value, so you only have to give the
ones you want to change. Some parameter values consist of more than one
argument, separated by comma. The values of the parameters which
determine time and DST settings for the cities must have an equal
number of arguments (that means, the number of commas must be equal).
Everything before the first comma, between the commas and after the
last comma is treated as an argument, so don't type spaces after the
commas.
And here are all the possible parameters:
| parameter | function | possible values | default value | |
| names | the names of the cities | a list of the names, separated by commas | Guatemala,New York,Rio de Janeiro, London,Moscow,Sydney | |
| addnames1 addnames2 ... | optional additional city names | a list of the names, separated by commas | ||
| offset | the offset of the local time from GMT, without DST | a list of integers with an optional minus-sign (don't type plus-sign) | -6,-5,-3,0,3,10 | |
| unit | whether the offset is given in hours or minutes | hour or min | hour | |
| usedst | whether the cities are observing DST | a list of no and yes | no,yes,yes,yes,yes,yes | |
| startmonth | the month DST starts | a list of integers, where 1 means January, 2 February ... | ,4,10,3,3,10 | |
| startday | the day of the week DST starts | a list of integers, where 0 means Sunday, 1 Monday ... | ,0,0,0,0,0 | |
| startweek | whether DST starts on the first or the last day of the week of the month | a list of 1 and -1 where 1 means the first and -1 the last week | ,1,1,-1,-1,-1 | |
| endmonth | the month DST ends | a list of integers, where 1 means January, 2 February ... | ,10,2,10,10,3 | |
| endday | the day of the week DST ends | a list of integers, where 0 means Sunday, 1 Monday ... | ,0,0,0,0,0 | |
| endweek | whether DST ends on the first or the last day of the week of the month | a list of 1 and -1 where 1 means the first and -1 the last week | ,-1,-1,-1,-1,-1 | |
| The DST rules can be found on many websites, see e.g. www.timeanddate.com/worldclock. | ||||
| timeformat | whether to show the time in 24 or 12 hour format | 12 (this gives something like "9:33:45 AM") or 24 (this gives something like "09:33:45") | 24 | |
| weekdays | provides the words for the weekdays | a list of 7 words, where the first one corresponds to Sunday, the second to Monday ... | Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday | |
| dateformat | the order and delimiters of the date contributions | the characters d, m, y in the order in which day, month and year will appear, separated by the desired one-character delimiters (e.g. d.m.y) | y/m/d | |
| showanalog | whether to show the analog display | yes or no | yes | |
| showam | whether to show "AM" or "PM" below the analog display | yes or no | yes | |
| showdsta | whether to show "DST" below the analog display when the city is running under DST | yes or no | no | |
| showseca | whether to show the seconds in the analog display | yes or no | yes | |
| showdigital | whether to show the digital display | yes or no | no | |
| showdstd | whether to show "DST" in the digital display when the city is running under DST | yes or no | no | |
| showsecd | whether to show the seconds in the digital display | yes or no | yes | |
| showday | whether to show the day of the week | yes or no | yes | |
| showdate | whether to show the date | yes or no | yes | |
| cityfont | type, face and size of the font for the city | a list type,face,size, where type can be any font the browser can handle, face can be plain, bold or italic and size an integer (in points) | TimesRoman,plain,12 | |
| timefont | type, face and size of the font for the time | the same as cityfont | ||
| datefont | type, face and size of the font for the day of the week and the date | the same as cityfont | ||
| clocksize | the diameter of the analog display | an integer (in points) | 60 | |
| hspace | the space between the clocks and the margin | an integer (in points) | 12 | |
| vspace | the space between the lines | an integer (in points) | 0 | |
| fgcolor | the foreground-color | a list of three integers between 0 and 255, determining the contributions of red, green and blue | 0,0,0 (this gives black) | |
| bgcolor | the background-color | the same as fgcolor | 255,255,255 (this gives white) | |
| bdcolor | the border-color | the same as fgcolor | ||
| bdwidth | the width of the border | an integer (in points) | 1 | |
Here is an example for the complete code you have to add to your web page:
<APPLET CODE="WorldTimeClock.class" WIDTH="700" HEIGHT="210">
<PARAM NAME="names" VALUE="Guatemala,New York,Rio de Janeiro,London,Moscow,Sydney">
<PARAM NAME="addnames1" VALUE=",Ottawa,Sao Paulo,Dublin,,Port Moresby">
<PARAM NAME="addnames2" VALUE=",,,Reykjavik,,">
<PARAM NAME="offset" VALUE="-6,-5,-3,0,3,10">
<PARAM NAME="usedst" VALUE="no,yes,yes,yes,yes,yes">
<PARAM NAME="startmonth" VALUE=",4,10,3,3,10">
<PARAM NAME="startday" VALUE=",0,0,0,0,0">
<PARAM NAME="startweek" VALUE=",1,1,-1,-1,-1">
<PARAM NAME="endmonth" VALUE=",10,2,10,10,3">
<PARAM NAME="endday" VALUE=",0,0,0,0,0">
<PARAM NAME="endweek" VALUE=",-1,-1,-1,-1,-1">
<PARAM NAME="timeformat" VALUE="12">
<PARAM NAME="showam" VALUE="no">
<PARAM NAME="showdigital" VALUE="yes">
<PARAM NAME="showdstd" VALUE="yes">
<PARAM NAME="cityfont" VALUE="TimesRoman,bold,12">
<PARAM NAME="timefont" VALUE="Courier,plain,14">
<PARAM NAME="datefont" VALUE="TimesRoman,italic,12">
<PARAM NAME="bdcolor" VALUE="255,0,0">
</APPLET>
This gives the applet you see on the top of this page. (It does as well, if you don't give the first 11 parameters, except the second and the third, because they have the default values.)
5. Adjust width and height of the applet so that they fit your settings.
6. Play around with the parameters and create the clock you like!
Is it working on your page too? Let me know: pge97afn@yahoo.de.
P.S. The clock does not appear on www.marvelclan.com. Find out why.