• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Date() > Description

Description

When JavaScripters talk about getting a date, often we aren't referring to the kind involving a gourmet restaurant. Instead, we may be talking about getting a date from the browser, via the Date() object. JavaScript provides this kind of object specifically for us to have a reference to moments of time as objects in the browser.

A Special Number Line for Time

The nice thing about JavaScript is the designers knew Web page developers would want some way to reference dates and times in JavaScript. Therefore, the designers of the language created a special application of the number line for handling time. 0 in the context of this number line referred to precisely January 1st, 1970, at midnight: the start of that particular year. They also declared increments of 1 along this number line to be increases of one millisecond. (A millisecond is 1/1000th of a second.) Thus, 1,000 would indicate 12:00:01 a.m. on January 1st, 1970 in GMT (Greenwich Mean Time) time, precisely.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint