Which built-in object handles dates and times?

The story behind the answer

The built-in JavaScript object that handles dates and times is `Date`.

JavaScript’s `Date` object represents a particular point in time and provides methods for creating, reading, formatting, and comparing date-and-time values. For example, `new Date()` creates an object representing the current moment, while `new Date(2010, 2, 1)` constructs a date using numeric components. JavaScript’s month index is zero-based, so `2` means March rather than February.

Internally, a Date value is based on a signed count of milliseconds from the Unix epoch: 1970-01-01 00:00:00 UTC. The object can expose values in either local time or UTC, which is important when applications serve users in multiple time zones. Methods such as `getFullYear()` and `getUTCFullYear()` deliberately use different time bases.

`DateTime` and `Calendar` may exist as names in libraries or other programming languages, but they are not JavaScript’s standard built-in date object. Developers should also distinguish a Date object from a formatted date string, and remember that date parsing and time-zone conversion can produce surprising results.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: