Formats a given date in the specified time zone and format string

  • Parameters

    • date: Date

      The date to be formatted

    • formatString: string

      The format string to be used for formatting the date

    • timeZone: string = ...

      (Optional) The time zone to be used for formatting the date. If not specified, the local time zone is used. Offsets and IANA both supported. Ex: (+08:00, +08, Z, Z+8, PST)

    Returns string

    The formatted date string