Skip to content

applyTimezone

The applyTimezone() function shifts a TheDate by applying the offset of an IANA timezone.

Interactive example

Syntax

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

Parameters

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

Return value

A TheDate shifted to the requested timezone.

See also

Released under the MIT license.