WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

JavaScript Date Reference


Date Object

The Date object is utilized to work with dates and times.

Date objects are made with new Date().

There are four different ways of instantiating a date:

var d = new Date();
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);

Date Object Properties

Property Description
constructor Returns the capacity that made the Date item's prototype
prototype Allows you to add properties and strategies to an object

Date Object Methods

Method Description
getDate() Returns the day of the month (from 1-31)
getDay() Returns the day of the week (from 0-6)
getFullYear() Returns the year
getHours() Returns the hour (from 0-23)
getMilliseconds() Returns the milliseconds (from 0-999)
getMinutes() Returns the minutes (from 0-59)
getMonth() Returns the month (from 0-11)
getSeconds() Returns the seconds (from 0-59)
getTime() Returns the quantity of milliseconds since midnight Jan 1 1970, and a indicated date
getTimezoneOffset() Returns the time distinction between UTC time and neighborhood time, in minutes
getUTCDate() Returns the day of the month, as per general time (from 1-31)
getUTCDay() Returns the day of the week, as per general time (from 0-6)
getUTCFullYear() Returns the year, as per general time
getUTCHours() Returns the hour, as per general time (from 0-23)
getUTCMilliseconds() Returns the milliseconds, as per general time (from 0-999)
getUTCMinutes() Returns the minutes, as per general time (from 0-59)
getUTCMonth() Returns the month, as per general time (from 0-11)
getUTCSeconds() Returns the seconds, as per general time (from 0-59)
getYear() Deprecated. Use the getFullYear() strategy instead
now() Returns the quantity of milliseconds since midnight Jan 1, 1970
parse() Parses a date string and returns the quantity of milliseconds since January 1, 1970
setDate() Sets the day of the long stretch of a date object
setFullYear() Sets the time of a date object
setHours() Sets the hour of a date object
setMilliseconds() Sets the milliseconds of a date object
setMinutes() Set the minutes of a date object
setMonth() Sets the long stretch of a date object
setSeconds() Sets the seconds of a date object
setTime() Sets a date to a predetermined number of milliseconds after/before January 1, 1970
setUTCDate() Sets the day of the long stretch of a date object, as indicated by all inclusive time
setUTCFullYear() Sets the time of a date object, as per all inclusive time
setUTCHours() Sets the hour of a date object, as per all inclusive time
setUTCMilliseconds() Sets the milliseconds of a date object, as per all inclusive time
setUTCMinutes() Set the minutes of a date object, as per all inclusive time
setUTCMonth() Sets the long stretch of a date object, as indicated by all inclusive time
setUTCSeconds() Set the seconds of a date object, as per all inclusive time
setYear() Deprecated. Use the setFullYear() technique instead
toDateString() Converts the date bit of a Date object into a coherent string
toGMTString() Deprecated. Use the toUTCString() strategy instead
toISOString() Returns the date as a string, utilizing the ISO standard
toJSON() Returns the date as a string, arranged as a JSON date
toLocaleDateString() Returns the date part of a Date object as a string, utilizing area conventions
toLocaleTimeString() Returns the time segment of a Date object as a string, utilizing district conventions
toLocaleString() Converts a Date article to a string, utilizing area conventions
toString() Converts a Date item to a string
toTimeString() Converts the time segment of a Date article to a string
toUTCString() Converts a Date item to a string, as per all inclusive time
UTC() Returns the quantity of milliseconds in a date since midnight of January 1, 1970, as per UTC time
valueOf() Returns the crude estimation of a Date object