To use this date object, you need to first create an instance of it. Uh? Instant noodles? Well, not quite. What we have to do is tell JavaScript to activate this object:
In previous article JavaScript Status clock – Basic we see simple technique to add clock at browser status bar. Now we are going to manipulate data which we get from Date object constructor. Using the date object and some of its methods, you can create your own JavaScript clock customized to our needs.
For the scripts that follow, the above is our hero people, not some Hollywood actor. Date.getTime() is a prebuilt JS method that returns the time elapsed from January 1st, 1970 to the current Date instance, in milliseconds. Its superpower is not so much its long term memory, as impressive as that may be, but its knack for converting a date to a number (in milliseconds, but nevertheless). And we all know the easiest subjects to perform arithmetic on are numbers
When creating a Date object based on the computer's (not web server's!) internal clock, it is important to note that if someone's clock is off by a few hours or they are in a different time zone, then the Date object will create a different time than the one created with your own computer.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.