Javascript - Date class reference

Introduction

Date class works with date value.

Property

PropertyDescription
Date constructor PropertyIn JavaScript, the constructor property returns the constructor function for an object.
Date prototype PropertyThe prototype constructor allows you to add new properties and methods to the Date() class.

Method

MethodDescription
Date getDate() MethodThe getDate() method returns the day of the month (from 1 to 31) for the date object.
Date getDay() MethodThe getDay() method returns the day of the week (from 0 to 6) from the date object.
Date getFullYear() MethodThe getFullYear() method returns the year as four digits for dates between year 1000 and 9999 from the date object.
Date getHours() MethodThe getHours() method returns the hour ranged from 0 to 23 of the date object.
Date getMilliseconds() MethodThe getMilliseconds() method returns the milliseconds ranged from 0 to 999 of the date object.
Date getMinutes() MethodThe getMinutes() method returns the minutes ranged from 0 to 59 of the date object.
Date getMonth() MethodThe getMonth() method returns the month ranged from 0 to 11 from the date object in local time.
Date getSeconds() MethodThe getSeconds() method returns the seconds ranged from 0 to 59 from the date object.
Date getTime() MethodThe getTime() method returns the number of milliseconds between midnight of January 1, 1970 and the date object.
Date getTimezoneOffset() MethodThe getTimezoneOffset() method returns the time difference between UTC time and local time, in minutes.
Date getUTCDate() MethodThe getUTCDate() method returns the day of the month ranged from 1 to 31 from the date object, according to universal time.
Date getUTCDay() MethodThe getUTCDay() method returns the day of the week ranged from 0 to 6 for the date object, according to universal time.
Date getUTCFullYear() MethodThe getUTCFullYear() method returns the year as four digits for dates between year 1000 and 9999 of the date object, according to universal time.
Date getUTCHours() MethodThe getUTCHours() method returns the hour ranged from 0 to 23 of date object, according to universal time.
Date getUTCMilliseconds() MethodThe getUTCMilliseconds() method returns the milliseconds ranged from 0 to 999 from the date object, according to universal time.
Date getUTCMinutes() MethodThe getUTCMinutes() method returns the minutes ranged from 0 to 59 of the date object, according to universal time.
Date getUTCMonth() MethodThe getUTCMonth() method returns the month ranged from 0 to 11 for the specified date, according to universal time.
Date getUTCSeconds() MethodThe getUTCSeconds() method returns the seconds ranged from 0 to 59 of the date object, according to universal time.
Date now() MethodThe now() method returns the number of milliseconds since January 1, 1970 00:00:00 UTC.
Date parse() MethodThe parse() method parses a date string and returns the number of milliseconds between the date and midnight of January 1, 1970.
Date setDate() MethodThe setDate() method sets the day of the month to the date object.
Date setFullYear() MethodThe setFullYear() method sets the year using four digits for dates between year 1000 and 9999 for the date object.
Date setHours() MethodThe setHours() method sets the hour of a date object.
Date setMilliseconds() MethodThe setMilliseconds() method sets the milliseconds of a date object.
Date setMinutes() MethodThe setMinutes() method sets the minutes of a date object.
Date setMonth() MethodThe setMonth() method sets the month of a date object.
Date setSeconds() MethodThe setSeconds() method sets the seconds of a date object.
Date setTime() MethodThe setTime() method sets a date and time by adding/subtracting a specified number of milliseconds to/from midnight January 1, 1970.
Date setUTCDate() MethodThe setUTCDate() method sets the day of the month, according to the UTC time.
Date setUTCFullYear() MethodThe setUTCFullYear() method sets the year (four digits for dates between year 1000 and 9999) of a date object, according the UTC time.
Date setUTCHours() MethodThe setUTCHours() method sets the hour of a date object, according to the UTC time.
Date setUTCMilliseconds() MethodThe setUTCMilliseconds() method sets the milliseconds between 0 to 999, according to universal time.
Date setUTCMinutes() MethodThe setUTCMinutes() method sets the minutes of a date object, according to UTC time.
Date setUTCMonth() MethodThe setUTCMonth() method sets the month ranged from 0 to 11, according to universal time.
Date setUTCSeconds() MethodThe setUTCSeconds() method sets the seconds of a date object, according to UTC time time.
Date toDateString() MethodThe toDateString() method converts the date part of a Date object into a readable string.
Date toISOString() MethodThe toISOString() method converts a Date object into a string, using the ISO-8601 standard.
Date toJSON() MethodThe toJSON() method converts a Date object a JSON date in string.
Date toLocaleDateString() MethodThe toLocaleDateString() method converts the date part of a Date object into a readable string, using locale settings.
Date toLocaleString() MethodThe toLocaleString() method converts a Date object to a string, using locale settings.
Date toString() MethodThe toString() method converts a Date object to a string.
Date valueOf() MethodThe valueOf() method returns the primitive value of a Date object.
Date toLocaleTimeString() MethodThe toLocaleTimeString() method returns the time part of a Date object as a string, using locale conventions.
Date UTC() MethodThe UTC() method returns the number of milliseconds between a specified date and midnight of January 1, 1970, according to universal time.
Date toTimeString() MethodThe toTimeString() method converts the time portion of a Date object to a string.
Date toUTCString() MethodThe toUTCString() method converts a Date object to a string, according to universal time.