A simple and interactive Digital Clock built with HTML, CSS, and JavaScript.
It displays the current time (hours, minutes, seconds) and date (day, month, year) in real-time.
- Features
- How It Works
- Project Structure
- Demo Screenshot
- Technologies Used
- Installation / How to Run Locally
- Displays real-time digital clock (updates every second)
- Shows current date (DD/MM/YYYY)
- Clean and modern gradient background
- Responsive and lightweight
- The script fetches the current system time using JavaScript’s
Date()object. - It updates the hours, minutes, seconds, day, month, and year every second.
- Leading zeros are added for single-digit numbers (e.g.,
09). - The time and date are displayed on the screen in a styled layout.
DigitalClock/
│── DigitalClock.html # Main HTML file
│── DigitalClock.css # Styling
│── DigitalClock.js # Clock logic
│── DigitalClock.png # Demo screenshot
│── README.md # Project documentation
Here is a screenshot of the project running in the browser:
- HTML5 → Structure of the clock
- CSS3 → Styling and gradient background
- JavaScript (ES6) → Logic for real-time updates
To run this project locally:
# Clone the repository
git clone https://github.com/your-username/DigitalClock.git
# Open the project folder
cd DigitalClock
# Run in your browser
open DigitalClock.html
# Or simply double-click DigitalClock.html to open it in your browser