The calendar date of an instant, read in timeZone and cut to
precision.
value is a Date, or the ISO string a Date is written as by
JSON.stringify, which names its zone. With the default zone, "UTC", it
gives the day a citation date stored as midnight UTC of that day means.
Pass the zone the value was written in to recover a day stored at local
midnight.
A string that is already a calendar date comes back as it is, cut to
precision only when it is longer, so converting a partly converted store
twice changes nothing and never invents a month or day.
TypeError when value is neither a valid instant nor a calendar
date, including a date-time string that names no zone or names a day or
time that does not exist.
Throws
RangeError when the year falls outside 0000-9999, or timeZone
is not a time zone Intl.DateTimeFormat knows.
The calendar date of an instant, read in
timeZoneand cut toprecision.valueis aDate, or the ISO string aDateis written as byJSON.stringify, which names its zone. With the default zone,"UTC", it gives the day a citation date stored as midnight UTC of that day means. Pass the zone the value was written in to recover a day stored at local midnight.A string that is already a calendar date comes back as it is, cut to
precisiononly when it is longer, so converting a partly converted store twice changes nothing and never invents a month or day.