Digital Clock is a simple React project that displays the current time and updates every second. It demonstrates the use of React hooks (useState, useEffect) for state management and lifecycle handling.
Check out the deployed app on Vercel:
👉 Digital Clock on Vercel
- React – JavaScript library for building UI components.
- CSS – Styles the clock display.
- JavaScript (ES6+) – Handles date and time updates.
- The component initializes the state with the current time.
- A
useEffecthook sets up an interval to update the time every second. - The time is formatted using
toLocaleTimeString()and displayed on the screen.