DATE

Casts a string value to a date.

Syntax

DATE(value)

Arguments

NameTypeDescriptionDefault Value

value

string

Returns

Returns a date value.


Examples

valueOutput

'2022-02-01'

date '2022-02-01'

timestamp '2022-02-01 00:00:00'

date '2022-02-01'

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

date '2022-01-01'

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 value,
        DATE(value) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET value = '2022-02-01'
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

valueOutput

'2022-02-01'

date '2022-02-01'

Last updated