JavaScript Date Methods

About This Index
This page is the JavaScript Date Methods index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn what a Date is on /js/date. Use this page when you need a specific API such as getFullYear(), getMonth(), or toISOString().
Start with getFullYear(), getMonth(), toISOString(), and Date.now()—then browse local getters, UTC methods, and setters.
How to Call a Date Method
Instance methods use a dot; static helpers use Date:
const birthday = new Date(2026, 0, 15);
// Instance (Date.prototype)
birthday.getFullYear(); // 2026
birthday.getMonth(); // 0
birthday.toISOString(); // UTC string
// Static (on Date)
Date.now(); // current ms
Date.UTC(2026, 0, 15); // UTC timestamp
Date.parse("2026-01-15T00:00:00.000Z"); // ms or NaN JavaScript Date Methods Table
All method guides in this JavaScript tutorial series (46 tutorials).
Getting Started
4 methodsCreate timestamps and read core Date concepts first.
| Method | Description | Tutorial |
|---|---|---|
Date.now() | Returns the current timestamp in milliseconds since the Unix epoch. | Open |
Date.parse() | Parses a date string and returns milliseconds since 1 Jan 1970 UTC, or NaN if invalid. | Open |
Date.UTC() | Builds a UTC timestamp from year, month, day, and optional time parts. | Open |
getTime() | Returns milliseconds since 1 Jan 1970 UTC — the internal timestamp. | Open |
Local Getters
9 methodsRead date and time parts in the user's local timezone.
| Method | Description | Tutorial |
|---|---|---|
getDate() | Returns the day of the month (1–31) in local time. | Open |
getDay() | Returns the day of the week (0 = Sunday … 6 = Saturday) in local time. | Open |
getFullYear() | Returns the four-digit year in local time. | Open |
getMonth() | Returns the month index (0 = January … 11 = December) in local time. | Open |
getHours() | Returns the hour (0–23) in local time. | Open |
getMinutes() | Returns the minutes (0–59) in local time. | Open |
getSeconds() | Returns the seconds (0–59) in local time. | Open |
getMilliseconds() | Returns the milliseconds portion (0–999) in local time. | Open |
getTimezoneOffset() | Returns local offset from UTC in minutes (positive west of UTC). | Open |
UTC Getters
8 methodsRead components in Coordinated Universal Time.
| Method | Description | Tutorial |
|---|---|---|
getUTCDate() | Returns the day of the month (1–31) in UTC. | Open |
getUTCDay() | Returns the day of the week (0–6) in UTC. | Open |
getUTCFullYear() | Returns the four-digit year in UTC. | Open |
getUTCMonth() | Returns the month index (0–11) in UTC. | Open |
getUTCHours() | Returns the hour (0–23) in UTC. | Open |
getUTCMinutes() | Returns minutes (0–59) in UTC. | Open |
getUTCSeconds() | Returns seconds (0–59) in UTC. | Open |
getUTCMilliseconds() | Returns milliseconds (0–999) in UTC. | Open |
Local Setters
8 methodsChange date and time parts in local time (mutates the object).
| Method | Description | Tutorial |
|---|---|---|
setDate() | Sets the day of the month in local time; mutates the Date object. | Open |
setFullYear() | Sets the year (and optionally month and date) in local time. | Open |
setMonth() | Sets the month index in local time; may roll the day if needed. | Open |
setHours() | Sets the hour and optionally minutes, seconds, and ms in local time. | Open |
setMinutes() | Sets minutes and optionally seconds and ms in local time. | Open |
setSeconds() | Sets seconds and optionally milliseconds in local time. | Open |
setMilliseconds() | Sets the milliseconds component in local time. | Open |
setTime() | Sets the date from a millisecond timestamp since the epoch. | Open |
UTC Setters
7 methodsChange components in UTC.
| Method | Description | Tutorial |
|---|---|---|
setUTCDate() | Sets the day of the month in UTC. | Open |
setUTCFullYear() | Sets the year in UTC, optionally with month and date. | Open |
setUTCMonth() | Sets the month index in UTC. | Open |
setUTCHours() | Sets the hour in UTC, optionally with minutes, seconds, and ms. | Open |
setUTCMinutes() | Sets minutes in UTC, optionally seconds and ms. | Open |
setUTCSeconds() | Sets seconds in UTC, optionally milliseconds. | Open |
setUTCMilliseconds() | Sets the milliseconds component in UTC. | Open |
Formatting & Conversion
10 methodsTurn Date objects into strings for display or APIs.
| Method | Description | Tutorial |
|---|---|---|
toISOString() | Returns an ISO 8601 UTC string — ideal for APIs and JSON. | Open |
toLocaleString() | Formats date and time using locale-specific rules. | Open |
toLocaleDateString() | Formats the date portion using locale-specific rules. | Open |
toLocaleTimeString() | Formats the time portion using locale-specific rules. | Open |
toDateString() | Returns a human-readable date string (weekday, month, day, year). | Open |
toTimeString() | Returns a human-readable time string with timezone info. | Open |
toUTCString() | Returns a UTC date/time string in HTTP-style format. | Open |
toString() | Returns a default string representation of the date and time. | Open |
toJSON() | Returns an ISO string; used when JSON.stringify serializes a Date. | Open |
valueOf() | Returns the primitive millisecond timestamp (same as getTime()). | Open |
Frequently Asked Questions
Start with Date.now()
Open the timestamp guide—syntax, examples, and FAQs.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
12 people found this page helpful
