We previously left off discussing a smattering of JavaScript Date Objects. In this tutorial we will continue the discussion, picking up with the GetFullYear() Method. There are a ton of Date methods, so let's get started.
Javascript Objects: More Date Methods - Putting the Three Together (Page 3 of 5 )
You can put the hour, minutes, and seconds together of course (as well as the other units of time). Here is a quick program to demonstrate how to do so:
<html>
<body>
<script type="text/javascript">
var time = new Date()
document.write("The time is currently: ")
document.write(time.getHours())
document.write(":")
document.write(time.getMinutes())
document.write(":")
document.write(time.getSeconds())
</script>
</body>
</html>
This would result in the print out:
The time is currently: 18:23:08
Of course we could always get really anal and add milliseconds to that as well: