USAGOV

Untitled

Jun 3rd, 2014
203
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <button onclick="myFunction()">Try it</button>
  6.  
  7. Registration Time
  8.  
  9. <p id="demo">
  10. <script>
  11. function myFunction() {
  12. var d = new Date();
  13. document.getElementById("demo").innerHTML = d.getTime();
  14. }
  15. </script>
  16.  
  17. <br />
  18. <br />
  19.  
  20.  
  21. <script>
  22. function startTime() {
  23. var today=new Date();
  24. var h=today.getHours();
  25. var m=today.getMinutes();
  26. var s=today.getSeconds();
  27. m = checkTime(m);
  28. s = checkTime(s);
  29. document.getElementById('txt').innerHTML = h+":"+m+":"+s;
  30. var t = setTimeout(function(){startTime()},500);
  31. }
  32.  
  33. function checkTime(i) {
  34. if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
  35. return i;
  36. }
  37. </script>
  38. Current Time
  39. <body onload="startTime()">
  40.  
  41. <div id="txt"></div>
  42.  
  43. <br />
  44. <br />
  45.  
  46. <br />
  47. Spent Vote-Time:
  48. <br />00:00:00
  49.  
  50. <br />
  51. <br />
  52. Available Vote-Time:
  53. <br />
  54. <script>
  55. function startTime() {
  56. var today=new Date();
  57. var h=today.getHours();
  58. var m=today.getMinutes();
  59. var s=today.getSeconds();
  60. m = checkTime(m);
  61. s = checkTime(s);
  62. document.getElementById('txt').innerHTML = h+":"+m+":"+s;
  63. var t = setTimeout(function(){startTime()},500);
  64. }
  65.  
  66. function checkTime(i) {
  67. if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
  68. return i;
  69. }
  70. </script></body>
  71. </html>
RAW Paste Data