Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <style>
- body{
- height: 350px;
- width: 350px;
- }
- #nowTime{
- height: 60px;
- margin: 0 auto;
- font-family: Arial;
- font-size: 250%;}
- </style>
- </head>
- <body onLoad="time_now">
- <script>
- time_now(){
- newdata = new Date();
- hours = newdata.getHours();
- minutes = newdata.getMinutes();
- if(hours < 10){
- hours = "0" + hours;
- }
- if(minutes < 10){
- minutes = "0" + minutes;
- }
- wholetime = hours + ":" +minutes;
- document.nowTime.value = "" + wholetime;
- setTimeout("time_now()",1000);
- }
- </script>
- <form>
- <div id="nowTime" value="">
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement