> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: SwitchTimeZone

> Use the SwitchTimezone expression function in Integrate.io ETL to convert datetime values between time zones inside your pipeline transformations.

## Description

Changes a datetime value's time zone from the value's original time zone to the time zone given in tz\_string and returns the value.

## Syntax

`SwitchTimeZone(datetime_expression, tz_value)`

## Arguments

*datetime\_expression* - datetime expression in original time zone.

*tz\_value* - string representing the target time zone. Use an IANA (tz database) region identifier in `Area/City` form, such as `Europe/London`, `America/Chicago`, or `Asia/Tokyo`. See the [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) on Wikipedia for valid identifiers.

SwitchTimeZone changes how the instant is displayed, not the instant itself.

<Warning title="Daylight saving is automatic">
  Pick the region identifier for your location (for example, `Europe/London`) and let SwitchTimeZone handle the rest. Region identifiers adjust for daylight saving automatically using the tz database.

  Never pick a zone because its offset happens to match your clock today. A zone chosen by offset, or a different region that shares your current offset, will be wrong for part or all of the year. For example, `Europe/Madrid` sits at the same offset as `Europe/London` in summer but is permanently one hour ahead in winter.
</Warning>

## Examples

`SwitchTimeZone(ToDate('2014-11-01T23:30:00+02:00'),'America/Chicago')` returns `2014-11-01T15:30:00-06:00`

Daylight saving is applied automatically for the given region. In summer, `Europe/London` is one hour ahead of UTC:

`SwitchTimeZone(ToDate('2026-07-27T17:00:00Z'),'Europe/London')` returns `2026-07-27T18:00:00+01:00`

In winter, the same region is back at UTC+0:

`SwitchTimeZone(ToDate('2026-12-01T17:00:00Z'),'Europe/London')` returns `2026-12-01T17:00:00Z`

To build a dynamic lookback value for a SQL `WHERE` clause, combine SwitchTimeZone with ToString. This gives the current London wall-clock time minus 60 minutes, formatted for the query:

`ToString(SwitchTimeZone(SubtractDuration(CurrentTime(), 'PT1H'), 'Europe/London'), 'yyyy-MM-dd HH:mm:ss')`

## Return value datatype

Datetime

## Impact of null value

If datetime\_value is null, returns null. If tz\_value is null or invalid, an exception is raised.
