JavaScript Refresher and Detailed Study - Part 4
Last updated on 10 Sep 2026 Post series: Prev Part (3) Contents (sections and/or jump links) JavaScript Date objects represent a single moment in time in a platform-independent format and is timezone-agnostic - MDN JS .toString() output always uses GMT and not UTC due to historical reasons By default, alert uses .toString() method on Date objects showing local time but console.log on node.js uses .toISOString() which shows absolute UTC time Date object always stores date time in UTC (Absolute UTC, UTC+0) whose value is projected/converted to local date time or vice-versa for output/input purposes JavaScript Date time string format Main ways in which Date constructor can be used to create a new Date object; Date constructor views parameters as UTC or local time based on number of parameters with one exception Creating date object with date only component parameters viewed as local date Date constructor month parameter strangely is 0 indexed due to historical reasons Iss...