Display Time



Code Example

 <script>
  function displayTime() {
   now = new Date();
   document.getElementById("output").innerHTML = now;
   month = now.getMonth();
   day = now.getDay();
   date = now.getDate();
   year = now.getFullYear();
   time = now.getTime(); //number of milliseconds since midnight, January 1, 1970 //
   document.getElementById("output").innerHTML += '

' + "month: " + month + "
" + "day: " + day + "
" + "date:" + date + "
" + "year: " + year + "
" + " time: " + time; } </script>