The Date Object in JavaScript
The Date Object
The Date object enables us to work with dates. A date consists of a year, a month, a day, an hour, a minute, a second, and milliseconds.
We can initialize the date with a new Date(). When a Date object is created, a number of methods make it possible to perform operations on it.
List of Date object methods and properties are:-
Method | Description |
getFullYear() | gets the year |
getMonth() | gets the month |
getDate() | gets the day of month |
getDay() | gets the day of week |
getHours() | gets the hour |
getMinutes() | gets the minutes |
getSeconds() | gets the secinds |