Files
2nd/10_Wiki/Dev/Topic_JavaScript/JavaScript_Date_Formats.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

5.6 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
javascript-date-formats JavaScript Date Formats Frontend draft conceptual
date formats
ISO date
Date.parse
date string
date input formats
B 0.88 2026-06-23 2026-06-23
javascript
js
web
frontend
w3schools
date
format
https://www.w3schools.com/js/js_date_formats.asp

JavaScript Date Formats

🎯 한 줄 통찰 (One-line insight)

JavaScript accepts dates as ISO, Short, Long, and Full date strings; ISO is the preferred unambiguous format, and Date.parse() converts a valid date string into milliseconds since the epoch. [S1]

🧠 핵심 개념 (Core concepts)

  • Four input formats — JavaScript date input can be given as ISO, Short, Long, or Full date strings. [S1]
  • ISO format (YYYY-MM-DD) is the preferred JavaScript date format and is the most reliable. [S1]
  • Partial ISO dates are allowed — year and month ("2015-03") or just year ("2015"). [S1]
  • ISO date-time can include a T and time, with Z for UTC or an offset like -06:30. [S1]
  • Short / Long dates use formats like "03/25/2015" or "Mar 25 2015". [S1]
  • Date.parse() parses a valid date string and returns the number of milliseconds since January 1, 1970. [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Prefer ISO — use "YYYY-MM-DD" for unambiguous parsing. [S1]
  • UTC vs local — append Z for UTC, or an offset to specify a time zone. [S1]
  • String → msDate.parse(str), then optionally new Date(msec) to build a Date. [S1]

📖 세부 내용 (Details)

Date Input Formats — There are generally 4 types of JavaScript date input formats: ISO Date, Short Date, Long Date, and Full Date. The ISO format follows a strict standard in JavaScript and is the preferred format. [S1]

ISO Dates — A complete ISO date (YYYY-MM-DD): [S1]

const d = new Date("2015-03-25");

ISO date without day (year and month): [S1]

const d = new Date("2015-03");

ISO date with only year: [S1]

const d = new Date("2015");

ISO date-time with UTC (Z): [S1]

const d = new Date("2015-03-25T12:00:00Z");

ISO date-time with a time-zone offset: [S1]

const d = new Date("2015-03-25T12:00:00-06:30");

Short Dates — short dates are written with an MM/DD/YYYY syntax: [S1]

const d = new Date("03/25/2015");

Long Dates — long dates are most often written with a "MMM DD YYYY" syntax: [S1]

const d = new Date("Mar 25 2015");

The month and day can be in any order: [S1]

const d = new Date("25 Mar 2015");

The month can be written in full (January), or abbreviated (Jan): [S1]

const d = new Date("January 25 2015");
const d = new Date("Jan 25 2015");

Commas are ignored, and names are case insensitive: [S1]

const d = new Date("JANUARY, 25, 2015");

Date.parse()Date.parse() parses a date string and returns the number of milliseconds between the date and January 1, 1970: [S1]

let msec = Date.parse("March 21, 2012");

The result can then be used to create a Date object: [S1]

let msec = Date.parse("March 21, 2012");
const d = new Date(msec);

🛠️ 적용 사례 (Applied in summary)

The page's own snippets are the canonical applied examples — building dates from ISO, short, and long strings, including UTC and time-zone-offset variants, and converting a date string to milliseconds with Date.parse(). No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Preferred ISO date:

const d = new Date("2015-03-25");

ISO date-time, UTC vs offset:

const utc    = new Date("2015-03-25T12:00:00Z");
const offset = new Date("2015-03-25T12:00:00-06:30");

Parse a string to ms, then to a Date:

let msec = Date.parse("March 21, 2012");
const d = new Date(msec);

⚖️ 비교 및 선택 기준 (Comparison & decision criteria)

  • ISO vs Short vs Long — ISO (YYYY-MM-DD) is the preferred, strict, and most reliable format; Short (MM/DD/YYYY) and Long (MMM DD YYYY) are more permissive but ambiguous (month/day order can vary). Prefer ISO for unambiguous parsing. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

No contradictions found in the source. The source advises ISO as the preferred and most reliable format over the more permissive Short/Long forms. [S1]

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.88
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Date Formats" page (Astra wiki-curation, P-Reinforce v3.1 format).