Advertisement
Shiny_

Untitled

Nov 18th, 2014
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. timeCheck = (val) ->
  2.     if val < 10
  3.         val = "0" + val
  4.  
  5. getTime = ->
  6.     date = new Date()
  7.     hour = date.getHours()
  8.     minute = date.getMinutes()
  9.     second = date.getSeconds()
  10.  
  11.     hour = timeCheck(hour)
  12.     minute = timeCheck(minute)
  13.     second = timeCheck(second)
  14.  
  15.     document.getElementById("clock").innerHTML = "#{hour}:#{minute}:#{second}"
  16. setTimeout () -> getTime 500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement