@hebcal/hdate
    Preparing search index...

    Function getPseudoISO

    • Returns a string similar to Date.toISOString() but in the timezone tzid. Contrary to the typical meaning of Z at the end of the string, this is not actually a UTC date.

      Parameters

      • tzid: string
      • date: Date

      Returns string

      const dt = new Date(Date.UTC(2021, 0, 31, 7, 30, 50));
      getPseudoISO('UTC', dt); // '2021-01-31T07:30:50Z'
      getPseudoISO('America/New_York', dt); // '2021-01-31T02:30:50Z'
      getPseudoISO('Asia/Jerusalem', dt); // '2021-01-31T09:30:50Z'