Formats the date portion of dt as YYYY-MM-DD using the date's
local-time fields (year/month/day), not its UTC fields. The year is
always padded to at least 4 digits and negative years are prefixed
with -, matching the formatting that pad4 applies.
This is intentionally separate from Date.prototype.toISOString(),
which always reports in UTC and may report a different day for
dates near midnight in non-UTC time zones.
Formats the date portion of
dtasYYYY-MM-DDusing the date's local-time fields (year/month/day), not its UTC fields. The year is always padded to at least 4 digits and negative years are prefixed with-, matching the formatting thatpad4applies.This is intentionally separate from
Date.prototype.toISOString(), which always reports in UTC and may report a different day for dates near midnight in non-UTC time zones.