JavaScript Date Methods
You are Here:
Date Methods
The following table provides a list of all Date
methods available in JavaScript.
Event | Explanation |
---|---|
getDate() | Returns the day of the month (from 1 to 31) |
getDay() | Returns the day of the week (from 0-6) |
getFullYear() | Returns the year (in 4 digits) |
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 numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC (negative for prior times) |
getTimezoneOffset() | Returns the time-zone offset in minutes for the current locale. |
getUTCDate() | Returns the day of the month, according to universal time (from 1-31) |
getUTCDay() | Returns the day of the week, according to universal time (from 0-6) |
getUTCFullYear() | Returns the year, according to universal time (in 4 digits) |
getUTCHours() | Returns the hour, according to universal time (from 0-23) |
getUTCMilliseconds() | Returns the milliseconds, according to universal time (from 0-999) |
getUTCMinutes() | Returns the minutes, according to universal time (from 0-59) |
getUTCMonth() | Returns the month, according to universal time (from 0-11) |
getUTCSeconds() | Returns the seconds, according to universal time (from 0-59) |
now() | Returns the numeric value corresponding to the current time - the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC, with leap seconds ignored |
parse() | Parses a string representation of a date and returns the number of milliseconds since 1 January, 1970, 00:00:00, UTC, with leap seconds ignored |
setDate() | Sets the day of the month of a date object |
setFullYear() | Sets the year 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 month of a date object |
setSeconds() | Sets the seconds of a date object |
setTime() | Sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC, allowing for negative numbers for times prior |
setUTCDate() | Sets the day of the month of a date object, according to universal time |
setUTCFullYear() | Sets the year of a date object, according to universal time |
setUTCHours() | Sets the hour of a date object, according to universal time |
setUTCMilliseconds() | Sets the milliseconds of a date object, according to universal time |
setUTCMinutes() | Set the minutes of a date object, according to universal time |
setUTCMonth() | Sets the month of a date object, according to universal time |
setUTCSeconds() | Set the seconds of a date object, according to universal time |
toDateString() | Converts the date portion of a Date object into a readable string |
toISOString() | Converts a date to a string following the ISO 8601 Extended Format |
toJSON() | Returns a string representing the Date using toISOString(). Intended for use by JSON.stringify() |
toLocaleDateString() | Returns a string with a locality sensitive representation of the date portion of this date based on system settings |
toLocaleTimeString() | Returns a string with a locality sensitive representation of the time portion of this date based on system settings |
toLocaleString() | Converts a Date object to a string, using locale conventions |
toTimeString() | Returns the "time" portion of the Date as a human-readable string |
toUTCString() | Converts a date to a string using the UTC timezone |
UTC() | Returns the number of milliseconds since January 1, 1970, 00:00:00 UTC, with leap seconds ignored |
valueOf() | Returns the primitive value of a Date object |
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.