What Is the Date Object?

This article describes the different methods for obtaining dates in various formats. The Date object in JavaScript returns a number representing milliseconds since midnight on January 1, 1970. Time is presented in Coordinated Universal Time (UTC) and isn't converted to time zones. When using the getDay() function, it uses local time from the computer. However, when using getUTCDay(), it returns UTC day instead of local time. The Date object is very useful when we need a timestamp or something similar.

Instance properties

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

Date.prototype.constructor

The constructor function that created the instance object. For Date instances, the initial value is the Date constructor.