Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.68 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <meta charset="utf-8">
  4.         <style>
  5.             body{
  6.             height: 350px;
  7.             width: 350px;
  8.             }
  9.             #nowTime{
  10.             height: 60px;
  11.             margin: 0 auto;
  12.             font-family: Arial;
  13.             font-size: 250%;}
  14.         </style>
  15.     </head>
  16.     <body onLoad="time_now">
  17.         <script>
  18.     time_now(){
  19.         newdata = new Date();
  20.         hours = newdata.getHours();
  21.         minutes = newdata.getMinutes();
  22.         if(hours < 10){
  23.             hours = "0" + hours;
  24.            
  25.         }
  26.         if(minutes < 10){
  27.             minutes = "0" + minutes;
  28.         }
  29.         wholetime = hours + ":" +minutes;
  30.         document.nowTime.value = "" + wholetime;
  31.         setTimeout("time_now()",1000);
  32.        
  33.        
  34.     }
  35.         </script>
  36.         <form>
  37.             <div id="nowTime" value="">
  38.             </div>
  39.         </form>
  40.     </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement