TRUECALC
Functions

TZFROMEPOCH

Builds a zone-aware instant from a Unix timestamp

Try it

When to use it

When should I use TZFROMEPOCH instead of TZDATETIME?

Use TZFROMEPOCH when your source data is a Unix timestamp (integer seconds since 1970-01-01T00:00:00Z) from an API or database. Use TZDATETIME when you already have a human-readable date and time.

What does the zone argument do in TZFROMEPOCH?

It stamps the resulting instant with an IANA timezone for display purposes, converting the UTC epoch into local wall-clock time in that zone.

What happens if I pass a negative Unix timestamp to TZFROMEPOCH?

Negative values represent instants before 1970-01-01T00:00:00Z, so TZFROMEPOCH correctly builds dates in 1969 or earlier.

Use cases

Convert a database epoch to Tokyo time

Display a Unix timestamp in UTC

Used in

engineering · operations · logistics

Syntax

TZFROMEPOCH(unix_seconds,zone)

On this page