Documentation

    timezone

    With one argument, get the time zone offset of a timestamp in seconds. With two arguments, convert a time or timestamp to a time zone given as a name, or as an interval for a time with time zone.

    Try an expression

    In Formula, enter the expression and set Output type to VARCHAR.

    Expression

    timezone(INTERVAL '02:00', TIMETZ '12:00:00+00')

    Result

    '14:00:00+02'

    The expression returns TIME WITH TIME ZONE. Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    timezone([zone, ]ts)
    ts
    Date, Interval, Timestamp, Text

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    If the first argument is missing, the result is NULL.

    Browse dates & timesDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.