umber/MAX_SAFE_INTEGER) ,
which is 9,007,199,254,740,991). A ` Date ` object can represent a maximum of
Â±8,640,000,000,000,000 milliseconds, or Â±100,000,000 (one hundred million)
days, relative to the epoch. This is the range from April 20, 271821 BC to
September 13, 275760 AD. Any attempt to represent a time outside this range
results in the ` Date ` object holding a timestamp value of [ ` NaN ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/NaN) , which is an "Invalid
Date".

js

    
    
    console.log(new Date(8.64e15).toString()); // "Sat Sep 13 275760 00:00:00 GMT+0000 (Coordinated Universal Time)"
    console.log(new Date(8.64e15 + 1).toString()); // "Invalid Date"
    

There are various methods that allow you to interact with the timestamp stored
in the date:

  * You can interact with the timestamp value directly using the [ ` getTime() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) and [ ` setTime() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime) methods. 
  * The [ ` valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf) and [ ` [@@toPrimitive]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/@@toPrimitive) (when passed ` "number" ` ) methods â which are automatically called in [ number coercion ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion) â return the timestamp, causing ` Date ` objects to behave like their timestamps when used in number contexts. 
  * All static methods ( [ ` Date.now() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) , [ ` Date.parse() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse) , and [ ` Date.UTC() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC) ) return timestamps instead of ` Date ` objects. 
  * The [ ` Date() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date) constructor can be called with a timestamp as the only argument. 

###  Date components and time zones

A date is represented internally as a single number, the _timestamp_ . When
interacting with it, the timestamp needs to be interpreted as a structured
date-and-time representation. There are always two ways to interpret a
timestamp: as a local time or as a Coordinated Universal Time (UTC), the
global standard time defined by the World Time Standard. The local timezone is
not stored in the date object, but is determined by the host environment
(user's device).

**Note:** UTC should not be confused with the [ Greenwich Mean Time
](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) (GMT), because they are
not always equal â this is explained in more detail in the linked Wikipedia
page.

For example, the timestamp 0 represents a unique instant in history, but it
can be interpreted in two ways:

  * As a UTC time, it is midnight at the beginning of January 1, 1970, UTC, 
  * As a local time in New York (UTC-5), it is 19:00:00 on December 31, 1969. 

The [ ` getTimezoneOffset() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset) method
returns the difference between UTC and the local time in minutes. Note that
the timezone offset does not only depend on the current timezone, but also on
the time represented by the ` Date ` object, because of daylight saving time
and historical changes. In essence, the timezone offset is the offset from UTC
time, at the time represented by the ` Date ` object and at the location of
the host environment.

There are two groups of ` Date ` methods: one group gets and sets various date
components by interpreting the timestamp as a local time, while the other uses
UTC.

Component  |  Local  |  UTC   
---|---|---  
Get  |  Set  |  Get  |  Set   
Year  |  [ ` getFullYear() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear) |  [ ` setFullYear() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear) |  [ ` getUTCFullYear() ` ](/en-US/docs/W