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 | SerializedTheDate) => TheDate
typescript
function applyTimezone(
	input: TheDate | SerializedTheDate,
	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.