--- id: javascript-date-methods title: "JavaScript Date Methods" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["Date reference", "Date object methods", "Date prototype", "Date.parse", "Date.UTC", "toISOString"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["javascript", "js", "web", "frontend", "w3schools", "date", "reference"] raw_sources: ["https://www.w3schools.com/js/js_date_reference.asp"] applied_in: [] github_commit: "" --- # [[JavaScript Date Methods]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) This is the complete reference of `Date` object members β€” constructor/properties, get and set methods (local and UTC), utility statics, and string-conversion methods β€” the master index behind the more focused Date tutorials. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **The Date API splits into families** β€” constructor/properties, Get methods, Set methods, utility statics, and string-conversion methods. [S1] - **Every Get/Set field has a UTC counterpart** β€” e.g. `getDate()` / `getUTCDate()`, `setHours()` / `setUTCHours()`. [S1] - **Static utility methods** β€” `now()`, `parse()`, and `UTC()` are called on `Date` itself and work with millisecond timestamps. [S1] - **Many conversion methods** β€” `toString()`, `toISOString()`, `toDateString()`, `toLocaleString()`, and others render a Date as a string in different formats/locales. [S1] - **Deprecated members** β€” `getYear()`/`setYear()` (use `getFullYear()`/`setFullYear()`) and `toGMTString()` (use `toUTCString()`). [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Local vs UTC symmetry** β€” for any field, pick the plain method for local time or the `UTC` variant for universal time. [S1] - **Static parsing/construction** β€” turn strings or component lists into timestamps with `Date.parse()` and `Date.UTC()`, current time with `Date.now()`. [S1] - **Choose a string formatter by need** β€” ISO (`toISOString`), JSON (`toJSON`), locale-aware (`toLocale*String`), or date/time-only (`toDateString`, `toTimeString`). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) This page is a reference index of `Date` methods and properties grouped by family. No "Example" code boxes were present to capture; the content is the reference tables below. [S1] **Date Constructor & Properties** [S1] | Method/Property | Description | |---|---| | new Date() | Creates a new Date object | | constructor | Returns the function that created the Date prototype | | prototype | Allows you to add properties and methods to an object | **Date Get Methods** [S1] | 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 number of milliseconds since midnight Jan 1 1970 | | getTimezoneOffset() | Returns the time difference between UTC time and local time, in minutes | | getUTCDate() | Returns the day of the month, according to universal time (1-31) | | getUTCDay() | Returns the day of the week, according to universal time (0-6) | | getUTCFullYear() | Returns the year, according to universal time | | getUTCHours() | Returns the hour, according to universal time (from 0-23) | | getUTCMilliseconds() | Returns the milliseconds, according to universal time (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) | | getYear() | Deprecated. Use getFullYear() instead | **Date Set Methods** [S1] | Method | Description | |---|---| | 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 a date to a specified number of milliseconds after/before January 1, 1970 | | 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 | | setYear() | Deprecated. Use setFullYear() instead | **Date Utility Methods** [S1] | Method | Description | |---|---| | now() | Returns the number of milliseconds since midnight Jan 1, 1970 | | parse() | Parses a date string and returns milliseconds since January 1, 1970 | | UTC() | Returns the number of milliseconds in a date since midnight of January 1, 1970 | **Date String Conversion Methods** [S1] | Method | Description | |---|---| | toDateString() | Converts the date portion of a Date object into a readable string | | toGMTString() | Deprecated. Use toUTCString() instead | | toISOString() | Returns the date as a string, using the ISO standard | | toJSON() | Returns the date as a string, formatted as a JSON date | | toLocaleDateString() | Returns the date portion of a Date object as a string, using locale conventions | | toLocaleTimeString() | Returns the time portion of a Date object as a string, using locale conventions | | toLocaleString() | Converts a Date object to a string, using locale conventions | | toString() | Converts a Date object to a string | | toTimeString() | Converts the time portion of a Date object to a string | | toUTCString() | Converts a Date object to a string, according to universal time | | valueOf() | Returns the primitive value of a Date object | ## πŸ› οΈ 적용 사둀 (Applied in summary) As a reference page it has no worked examples; it is the lookup table consulted when picking the right Date method. Worked examples live in the focused tutorials ([[JavaScript Date Get Methods]], [[JavaScript Date Set Methods]]). No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Not found in source β€” this reference page contains no "Example" code boxes; only the method/property tables above. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) The reference marks `getYear()`/`setYear()` and `toGMTString()` as deprecated, pointing to `getFullYear()`/`setFullYear()` and `toUTCString()` respectively. No other contradictions found in the source. [S1] ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[JavaScript Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[JavaScript Date Get Methods]], [[JavaScript Date Set Methods]], [[JavaScript Dates]] - **μ°Έμ‘° λ§₯락:** The master index of the Date object β€” consulted to find the exact method name and signature. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” JavaScript Date Methods β€” https://www.w3schools.com/js/js_date_reference.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Date Methods" page (Astra wiki-curation, P-Reinforce v3.1 format).