Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shoaib-fateh/digital-clock
This is a simple digital clock created with HTML, CSS and JavaScript. It displays the current time in a digital format (hours:minutes:seconds).
https://github.com/shoaib-fateh/digital-clock
css html javascript
Last synced: about 1 month ago
JSON representation
This is a simple digital clock created with HTML, CSS and JavaScript. It displays the current time in a digital format (hours:minutes:seconds).
- Host: GitHub
- URL: https://github.com/shoaib-fateh/digital-clock
- Owner: shoaib-fateh
- Created: 2022-10-12T18:26:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-15T03:12:52.000Z (about 1 year ago)
- Last Synced: 2023-10-16T07:00:47.941Z (about 1 year ago)
- Topics: css, html, javascript
- Language: HTML
- Homepage: https://shoaib-fateh.github.io/digital-clock/
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Digital Clock
This is a simple digital clock created with HTML, CSS and JavaScript. It displays the current time in a digital format (hours:minutes:seconds).## How It Works
The clock element in HTML displays the time
A JavaScript function gets the current date/time using the Date object
It extracts the hours, minutes and seconds
leading zeros are added for values < 10
The time is displayed in the clock element by concatenating the values
The function runs every 500ms using setTimeout to update the clock## Live Demo
You can see it working live at https://shoaib-fateh.github.io/digital-clock/## Usage
To use it, include the HTML, CSS and JavaScript files. Call the clockFunction on page load to initially display the time.