Its Tell You Current Date & Time ⌚ HTML & CSS Code

Ticker

10/recent/ticker-posts

Its Tell You Current Date & Time ⌚ HTML & CSS Code

This Programming Tell You Current Date & Time

HTML Code

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Date And Time </title>
<body bgcolor="aqua">
<center><font size="10" color="green"><script type="text/javascript">
        document.write("Time");
           function showTime() {
                var a_p = "";
                var today = new Date();
                var curr_hour = today.getHours();
                var curr_minute = today.getMinutes();
                var curr_second = today.getSeconds();
                if (curr_hour < 12) {
                    a_p = "AM";
                } else {
                    a_p = "PM";
                }
                if (curr_hour == 0) {
                    curr_hour = 12;
                }
                if (curr_hour > 12) {
                    curr_hour = curr_hour - 12;
                }
                curr_hour = checkTime(curr_hour);
                curr_minute = checkTime(curr_minute);
                curr_second = checkTime(curr_second);
                document.getElementById('time').innerHTML=curr_hour + ":" + curr_minute + ":" + curr_second + " " + a_p;
        //btw i don't know to add years so i add manually so every year i must to change the year.😃 
 }
            function checkTime(i) {
                if (i < 10) {                          i = "0" + i;
               }
                return i;
            }
            setInterval(showTime, 500);         
        </script>
    </head>
</body>
    <body>
        <div id="time"></div>
        <div id="date"></div>
       <script>
            var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
            var date = new Date();
            var day = date.getDate();
            var month = date.getMonth(); document.getElementById("date" ).innerHTML =" " + day + " " + months[month] + " 2018";
        </script></center></font>


    </head>
    <body>
  <div style="background-color:rgb(142, 187, 146); color:rgb(230, 16, 16); padding:15px;">
    <font size="10"><marquee class="marquee">😀🥰😝Don't Forget to Follow & Share MAA Blogger😀🥰😝</marquee></font>
        
    </body>
</html> 


CSS Code

body {
    background-color:aquamarine;
}
.marquee{
   font-size:40px; 
   color:#df570981; 
   font-family: Florence, cursive;
   }


OUTPUT



Post a Comment

43 Comments

  1. Very good 💛❤💛❤

    ReplyDelete