TomasHack
Retro Anime Fan
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
This Simple Clock using Dropdown in Bootstrap Template. This simple tutorial creates using JavaScript, HTML, and Bootstrap Template for the GUI. Using the drop down function, you can set the time format in every city around the world. You can use this simple tutorial to change the time set in your web projects or in a system that you have. There's many time format around the world, but in this case, we have some list of cities in different time format to show you how's the result using the drop down in just one click.
To add more cities in different time format, kindly add in the drop down using the option tag and specify the offset of the city from the GMT inside the select option.
Check the LIVE DEMO below.
⚙ Live Demo
Example Time Format
We are going to create simple Markup to insert the list of cities that have a different time format.
This simple source code below, we have a list of cities to insert in the drop down. To select the users what time format that they want. Kindly copy and paste this source code in the select element.
The Complete Source Code
Copy and paste to the BODY tag of your web page.
One Example of Time Format
⚙ Live Demo
For the full source code, click the downloadable button below.
Try it and just have fun while you are in coding. Thank you. Happy coding.
Download
To add more cities in different time format, kindly add in the drop down using the option tag and specify the offset of the city from the GMT inside the select option.
Check the LIVE DEMO below.
⚙ Live Demo
Example Time Format
- <option
value
=
"9"
>
Tokyo</
option
>
- <option
value
=
"10"
>
Sydney</
option
>
- <option
value
=
"12"
>
Fiji</
option
>
- <option
value
=
"-10"
>
Hawaii</
option
>
We are going to create simple Markup to insert the list of cities that have a different time format.
- <table
border
=
"0"
width
=
"200"
cellspacing
=
"0"
cellpadding
=
"3"
>
- <form
>
- <tr
>
- <td
width
=
"100%"
>
- <select
name
=
"city"
size
=
"1"
class
=
"form-control"
onchange
=
"updateclock(this);"
>
- </
select
>
- </
td
>
- </
tr
>
- <tr
>
- <td
width
=
"100%"
>
- <h2
>
Output</
h2
>
- </
td
>
- </
tr
>
- <tr
>
- <td
width
=
"100%"
style
=
"color:blue;"
>
- <script
src
=
"js/function.js"
language
=
"JavaScript"
></
script
>
- </
td
>
- </
tr
>
- </
form
>
- </
table
>
This simple source code below, we have a list of cities to insert in the drop down. To select the users what time format that they want. Kindly copy and paste this source code in the select element.
- <option
value
=
""
selected>
Local time</
option
>
- <option
value
=
"0"
>
London GMT</
option
>
- <option
value
=
"1"
>
Rome</
option
>
- <option
value
=
"7"
>
Bangkok</
option
>
- <option
value
=
"8"
>
Hong Kong</
option
>
- <option
value
=
"9"
>
Tokyo</
option
>
- <option
value
=
"10"
>
Sydney</
option
>
- <option
value
=
"12"
>
Fiji</
option
>
- <option
value
=
"-10"
>
Hawaii</
option
>
- <option
value
=
"-8"
>
San Francisco</
option
>
- <option
value
=
"-5"
>
New York</
option
>
- <option
value
=
"-3"
>
Buenos Aires</
option
>
- <option
value
=
"10"
>
Hobart</
option
>
- <option
value
=
"4"
>
Abu Dhabi, Muscat</
option
>
- <option
value
=
"-9"
>
Alaska</
option
>
- <option
value
=
"2"
>
Jerusalem</
option
>
The Complete Source Code
Copy and paste to the BODY tag of your web page.
- <table
border
=
"0"
width
=
"200"
cellspacing
=
"0"
cellpadding
=
"3"
>
- <form
>
- <tr
>
- <td
width
=
"100%"
>
- <select
name
=
"city"
size
=
"1"
class
=
"form-control"
onchange
=
"updateclock(this);"
>
- <option
value
=
""
selected>
Local time</
option
>
- <option
value
=
"0"
>
London GMT</
option
>
- <option
value
=
"1"
>
Rome</
option
>
- <option
value
=
"7"
>
Bangkok</
option
>
- <option
value
=
"8"
>
Hong Kong</
option
>
- <option
value
=
"9"
>
Tokyo</
option
>
- <option
value
=
"10"
>
Sydney</
option
>
- <option
value
=
"12"
>
Fiji</
option
>
- <option
value
=
"-10"
>
Hawaii</
option
>
- <option
value
=
"-8"
>
San Francisco</
option
>
- <option
value
=
"-5"
>
New York</
option
>
- <option
value
=
"-3"
>
Buenos Aires</
option
>
- <option
value
=
"10"
>
Hobart</
option
>
- <option
value
=
"4"
>
Abu Dhabi, Muscat</
option
>
- <option
value
=
"-9"
>
Alaska</
option
>
- <option
value
=
"2"
>
Jerusalem</
option
>
- </
select
>
- </
td
>
- </
tr
>
- <tr
>
- <td
width
=
"100%"
>
- <h2
>
Output</
h2
>
- </
td
>
- </
tr
>
- <tr
>
- <td
width
=
"100%"
style
=
"color:blue;"
>
- <script
src
=
"js/function.js"
language
=
"JavaScript"
></
script
>
- </
td
>
- </
tr
>
- </
form
>
- </
table
>
One Example of Time Format

⚙ Live Demo
For the full source code, click the downloadable button below.
Try it and just have fun while you are in coding. Thank you. Happy coding.
Download
You must upgrade your account or reply in the thread to view hidden text.