LEGACY HAZARD
JavaScript `Date` API
1995 Netscape Spec
// ⚠️ Traps: 0-indexed months & in-place mutation
const d = new Date(2026, 2, 15); // Month 2 is March!
d.setDate(d.getDate() + 16); // Silent mutation!
const d = new Date(2026, 2, 15); // Month 2 is March!
d.setDate(d.getDate() + 16); // Silent mutation!
Month Index Interpretation
2 (March, 0-indexed)
Memory Mutation Hazard
Mutates in-place (original modified)
ISO String Output
2026-03-31T06:30:00.000Z
Timezone & DST Safety
Skips or duplicates hour across 2026-03-08 DST transition without zone metadata
Parsing Reliability
Implementation-dependent local vs UTC shift
Heap Memory Pointer State
Reference 'originalDate'
2026-03-31 (OVERWRITTEN)
Reference 'updatedDate'
Same Pointer (d === result)