Function timezoneOffset

  • Convert a timezone string (e.g., "America/Toronto") to its current UTC offset in minutes.

    Parameters

    • tz: string

      Timezone string, e.g. "America/Toronto"

    • Optionaldate: Date = ...

      The date for which you want the offset (default is now)

    Returns number

    • Offset in minutes (e.g., -240)