description |
---|
Converts the input expressions to the corresponding timestamp. |
- numeric_expression: A Unix epoch timestamp.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP(52 * 365.25 * 86400)
-- 2022-01-01 00:00:00
{% endcode %}
- string_expression: The string from which to extract the timestamp.
- format: String to specify format of the timestamp.
- replaceErrorWithNull: If 0, the function will fail when given malformed input. If 1, the function will return NULL when given malformed input.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP('2022-03-15 01:02:03.1245', 'YYYY-MM-DD HH:MI:SS', 1)
-- NULL
{% endcode %}
- numeric_expression: A Unix epoch timestamp.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP(1640131200)
-- 2021-12-22 00:00:00
{% endcode %}
- numeric_expression: A Unix epoch timestamp.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP(1640131200)
-- 2021-12-22 00:00:00
{% endcode %}
- numeric_expression: A Unix epoch timestamp.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP(52 * 365.25 * 86400)
-- 2022-01-01 00:00:00
{% endcode %}
- string_expression: String from which to extract the timestamp.
- format: String to specify format of the timestamp.
Examples
{% code title="TO_TIMESTAMP example" %}
SELECT TO_TIMESTAMP('2021-07-31 01:02:03', 'YYYY-MM-DD HH:MI:SS')
-- 2021-07-31 01:02:03
{% endcode %}