Date & Time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<script type="text/javascript"> var currentdate = new Date() document.write(currentdate) document.write("<BR>") var currentmonth = currentdate.getMonth()+1 document.write("Current months is ") document.write(currentmonth) document.write("<BR>") var currenthours = currentdate.getHours() document.write("Current hour ") document.write(currenthours) document.write("<BR>") var timeofday = (currenthours < 12) ? "AM" : "PM" currenthours = (currenthours > 12) ? currenthours - 12 : currenthours currenthours = (currenthours == 0) ? 12 : currenthours document.write(currenthours) //getMonth, getHours, getSeconds, getDay, getMinutes </script> |