UTC_TO_LOCAL()

All functions > DATE AND TIME > UTC_TO_LOCAL()

Interprets a naive UTC TIMESTAMP as an instant and returns it in the given timezone (TIMESTAMPTZ).

Signatures

Returns: The same instant expressed with the target zone

UTC_TO_LOCAL(timestamp: TIMESTAMP, timezone: VARCHAR) → TIMESTAMPTZ
sql
ParameterTypeRequiredDescription
timestampTIMESTAMPYesNaive TIMESTAMP whose fields are UTC wall time
timezoneVARCHARYesTarget IANA timezone name ('Europe/Paris') or fixed-offset name ('Etc/GMT-2' for UTC+2; sign is POSIX-inverted)

Notes

  • The first argument must be a naive TIMESTAMP (not TIMESTAMPTZ); its fields are read as UTC.
  • Accepts IANA timezone names ('Europe/Paris', 'America/New_York') or fixed-offset names ('Etc/GMT-2' for UTC+2, 'Etc/GMT+5' for UTC-5)
  • Note: the sign in 'Etc/GMT±N' is POSIX-inverted — 'Etc/GMT-2' means UTC+2
  • The return type is TIMESTAMPTZ(3)
  • Propagates NULL: if the input is NULL the result is NULL
  • Inverse direction (local wall time → UTC naive storage) uses LOCAL_TO_UTC()

Examples

FeatureQL
SELECT
    f1 := UTC_TO_LOCAL(TIMESTAMP '2024-03-15 09:50:00', 'Europe/Paris'), -- UTC to Paris (CET, UTC+1 in March)
    f2 := UTC_TO_LOCAL(TIMESTAMP '2024-03-15 09:50:00', 'America/New_York'), -- UTC to New York (EDT, UTC-4 in March)
    f3 := UTC_TO_LOCAL(NULL(TIMESTAMP), 'Europe/Paris') -- NULL propagates
;
Result
f1 TIMESTAMPf2 TIMESTAMPf3 TIMESTAMP
2024-03-15T10:50:002024-03-15T05:50:00NULL

Last update at: 2026/05/26 17:22:09