FROM_UNIXTIME

Convert Epoch seconds to a timestamp.

This function uses Epoch seconds as a value, to convert Epoch Milliseconds value divide the value by a thousand (value/1000)

Syntax

FROM_UNIXTIME(unix_timestamp)

Arguments

valueTypeDescriptionDefault Value

unix_timestamp

numeric

Returns

timestamp


Examples

datetimeOutput

1641000600

timestamp '2022-01-01 01:30:00'

1520672112.456

timestamp '2018-03-10 08:55:12.456'

Transformation job example

SQL

CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
  MAP_COLUMNS_BY_NAME
    SELECT unix_timestamp,
        FROM_UNIXTIME(unix_timestamp) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET unix_timestamp = 1641000600
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

unix_timestampOutput

1641000600

timestamp '2022-01-01 01:30:00'

Last updated