Create an Analog Clock using HTML, Two8


ये html code से आप watch बना सकते है

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Digital Watch</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
            font-family: Arial, sans-serif;
        }
        #clock {
            font-size: 48px;
            background: #000;
            color: #fff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
    </style>
</head>
<body>
    <div id="clock">00:00:00</div>

    <script>
        function updateClock() {
            const now = new Date();
            let hours = now.getHours().toString().padStart(2, '0');
            let minutes = now.getMinutes().toString().padStart(2, '0');
            let seconds = now.getSeconds().toString().padStart(2, '0');
            document.getElementById('clock').innerText = `${hours}:${minutes}:${seconds}`;
        }

        setInterval(updateClock, 1000);
        updateClock(); // Initial call to display clock immediately
    </script>
</body>
</html>

// Two8 // shambhu Bsc

Comments

Popular posts from this blog

एशिया की सबसे बड़ी सब्जी मंडी कौन सी है? भारत की सबसे बड़ी सब्जी मंडी कौन सी है?

भारत की सबसे बड़ी वेबसाइट कोसी है? Bharat ke top five (5) website konsi hai?

दिल्ली मेट्रो में ईन स्टेशन से सीट मिलेगी ? दिल्ली मेट्रो की येलो लाइन में सीट पाने के लिए, ये कुछ स्टेशन है!