Skip to content

getTimezoneOffset

The getTimezoneOffset() function returns the millisecond offset between a TheDate and an IANA timezone.

Interactive example

Syntax

typescript
function getTimezoneOffset(
	timezone: Timezone
): (input: TheDate) => number
typescript
function getTimezoneOffset(
	input: TheDate,
	timezone: Timezone
): number

Parameters

  • input: TheDate value (classic signature only).
  • timezone: IANA timezone.

Return value

Offset in milliseconds from UTC for the given timezone.

See also

Released under the MIT license.