Clock – a simple JavaScript app
The objective is to display information about time. Building a simple interface for it will improve your basic skills and knowledge of JavaScript.
Basic requirements
- Show the current time in the HH:MM:SS:MS format (a digital clock):
- minutes, seconds and milliseconds can be turned on and off
- the user can switch between the 12-hour and the 24-hour clock
- Show the current time on a classic clock face:
- the second and minute marks on the face can be turned on and off
- the second and minute hands can be turned on and off
Future improvements
- A choice of numerals on the clock face (in a dropdown): Arabic, Roman and custom (the developer’s choice).
- A choice of time zone, showing its name and the time difference.
- An option to show the day, month, year and day of the week.
- The script works as a library, with an API that returns the current time in the formats from the basic requirements.