Date Methods Reference
The following table lists all the get methods of Date object.
| Method | Description |
|---|---|
| getDate() | Returns numeric day (1 - 31) of the specified date. |
| getDay() | Returns the day of the week (0 - 6) for the specified date. |
| getFullYear() | Returns four digit year of the specified date. |
| getHours() | Returns the hour (0 - 23) in the specified date. |
| getMilliseconds() | Returns the milliseconds (0 - 999) in the specified date. |
| getMinutes() | Returns the minutes (0 - 59) in the specified date. |
| getMonth() | Returns the month (0 - 11) in the specified date. |
| getSeconds() | Returns the seconds (0 - 59) in the specified date. |
| getTime() | Returns the milliseconds as number since January 1, 1970, 00:00:00 UTC. |
| getTimezoneOffset() | Returns the time zone offset in minutes for the current locale. |
| getUTCDate() | Returns the day (1 - 31) of the month of the specified date as per UTC time zone. |
| getUTCDay() | Returns the day (0 - 6) of the week of the specified date as per UTC timezone. |
| getUTCFullYear() | Returns the four digits year of the specified date as per UTC time zone. |
| getUTCHours() | Returns the hours (0 - 23) of the specified date as per UTC time zone. |
| getUTCMilliseconds() | Returns the milliseconds (0 - 999) of the specified date as per UTC time zone. |
| getUTCMinutes() | Returns the minutes (0 - 59) of the specified date as per UTC time zone. |
| getUTCMonth() | Returns the month (0 - 11) of the specified date as per UTC time zone. |
| getUTCSeconds() | Returns the seconds (0 - 59) of the specified date as per UTC time zone. |
| getYear() | Returns the no of years of the specified date since 1990. This method is Deprecated |
The following table lists all the set methods of Date object.
| Method | Description |
|---|---|
| setDate() | Sets the day as number in the date object. |
| setFullYear() | Sets the four digit full year as number in the date object. Optionally set month and date. |
| setHours() | Sets the hours as number in the date object. Optionally set minutes, seconds and milliseconds. |
| setMilliseconds() | Sets the milliseconds as number in the date object. |
| setMinutes() | Sets the minutes as number in the date object. Optionally set seconds & milliseconds. |
| setMonth() | Sets the month as number in the date object. Optionally set date. |
| setSeconds() | Sets the seconds as number in the date object. Optionally set milliseconds. |
| setTime() | Sets the time as number in the Date object since January 1, 1970, 00:00:00 UTC. |
| setUTCDate() | Sets the day in the date object as per UTC time zone. |
| setUTCFullYear() | Sets the full year in the date object as per UTC time zone |
| setUTCHours() | Sets the hour in the date object as per UTC time zone |