description |
---|
Returns the Unix epoch time representation of an ISO 8601 timestamp. |
Examples
{% code title="UNIX_TIMESTAMP example" %}
SELECT UNIX_TIMESTAMP()
-- 1624928208
{% endcode %}
- date_timestamp_expression: The timestamp to convert to Unix timestamp. The expected format is ‘YYYY-MM-DD HH:MM:SS’ where HH can be a value 1-24.
Examples
{% code title="UNIX_TIMESTAMP example" %}
SELECT UNIX_TIMESTAMP('2021-12-22 13:44:11')
-- 1640180651
{% endcode %}
- date_timestamp_expression: The timestamp to convert to Unix timestamp.
- format: Specify the format of the time, date, or timestamp parameter. For example, ‘YY-MM-DD’ or ‘HH:MM:SS’.
Examples
{% code title="UNIX_TIMESTAMP example" %}
SELECT UNIX_TIMESTAMP('21-12-22', 'YY-MM-DD')
-- 1640131200
{% endcode %}