## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> UNIX_TIMESTAMP[UNIX_TIMESTAMP]:::quoted UNIX_TIMESTAMP --> End((END)) ``` ## Purpose The `UNIX_TIMESTAMP` SQL functions get the UNIX epoch time of a date/time. See also [[FROM_UNIXTIME]]. Parameters: - Input (optional, `datetime`): a `datetime`. Defaults to the current date/time. Returns: the UNIX epoch time. ## Examples The following example retrieves the UNIX epoch time of January 1, 2026 00:00:00 UTC: ```sql select unix_timestamp(to_date('20260101', 'YYYYMMDD')) ------------------- 1767225600 ``` The following example retrieves the UNIX epoch time of the last second of the year 9999: ```sql select unix_timestamp(to_date('99991231235959', 'YYYYMMDDHH24MISS')) ------------------- 253402300799 ```