@hebcal/hdate
    Preparing search index...

    Function isoDateString

    • 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.

      Parameters

      • dt: Date

      Returns string

      isoDateString(new Date(2008, 10, 13)); // '2008-11-13'
      isoDateString(new Date(2021, 0, 31)); // '2021-01-31'