use the local
time zone by default. Implementations are not required to return invalid date
for out-of-bounds date components, although they usually do. A string may have
in-bounds date components (with the bounds defined above), but does not
represent a date in reality (for example, "February 30"). Implementations
behave inconsistently in this case. The [ ` Date.parse() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#examples) page
offers more examples about these non-standard cases.

###  Other ways to format a date

  * [ ` toISOString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) returns a string in the format ` 1970-01-01T00:00:00.000Z ` (the date time string format introduced above, which is simplified [ ISO 8601 ](https://en.wikipedia.org/wiki/ISO_8601) ). [ ` toJSON() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) calls ` toISOString() ` and returns the result. 
  * [ ` toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) returns a string in the format ` Thu Jan 01 1970 00:00:00 GMT+0000 (Coordinated Universal Time) ` , while [ ` toDateString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [ ` toTimeString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) return the date and time parts of the string, respectively. [ ` [@@toPrimitive]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/@@toPrimitive) (when passed ` "string" ` or ` "default" ` ) calls ` toString() ` and returns the result. 
  * [ ` toUTCString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString) returns a string in the format ` Thu, 01 Jan 1970 00:00:00 GMT ` (generalized [ RFC 7231 ](https://datatracker.ietf.org/doc/html/rfc7231) ). 
  * [ ` toLocaleDateString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString) , [ ` toLocaleTimeString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString) , and [ ` toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) use locale-specific date and time formats, usually provided by the [ ` Intl ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API. 

See the  Formats of ` toString ` method return values  section for examples.

##  Constructor

[ ` Date() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)

    

When called as a constructor, returns a new ` Date ` object. When called as a
function, returns a string representation of the current date and time.

##  Static methods

[ ` Date.now() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/now)

    

Returns the numeric value corresponding to the current timeâthe number of
milliseconds elapsed since January 1, 1970 00:00:00 UTC, with leap seconds
ignored.

[ ` Date.parse() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)

    

Parses a string representation of a date and returns the number of
milliseconds since 1 January, 1970, 00:00:00 UTC, with leap seconds ignored.

[ ` Date.UTC() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)

    

Accepts the same parameters as the longest form of the constructor (i.e. 2 to
7) and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC,
with leap seconds ignored.

##  Instance properties

These properties are defined on ` Date.prototype ` and shared by all ` Date `
instances.

[ ` Date.prototype.constructor ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor)

    

The constructor function that created the instance object. For ` Date `
instances, the initial value is the [ ` Date ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date) constructor.

##  Instance methods

[ ` Date.prototype.getDate() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)

    

Returns the day of the month ( `