Date/Time
| Function Name | Description |
|---|---|
| CONVERT_TIMEZONE | Convert timestamp to the specified timezone |
| CURRENT_DATE | Returns the current date of the system. |
| CURRENT_DATE_UTC | Returns the current date of the system based on the UTC timezone. |
| CURRENT_TIME | Returns the current time for the system. |
| CURRENT_TIMESTAMP | Returns the current timestamp for the system in UTC time only. |
| DATEDIFF | Compares two dates or timestamps and returns the difference in days. |
| DATE_ADD | Returns the sum of two expressions of time as another expression of time. |
| DATE_DIFF | Returns the difference between two expressions of time as another expression of time. |
| DATE_PART | Return subfields such as year or hour from date or timestamp values |
| DATE_SUB | Returns the difference of two expressions of time as another expression of time. |
| DATE_TRUNC | Truncates the date or timestamp to the indicated precision. |
| DAY | Returns the day of month of the date or timestamp. |
| DAYOFMONTH | Returns the day of month of the date or timestamp. |
| DAYOFWEEK | Returns the day of the week (from 1 to 7) of the date or timestamp. |
| DAYOFYEAR | Returns the day of the year (from 1 to 366) of the date or timestamp. |
| EXTRACT | Extracts the specified date or time part from the date or timestamp. |
| HOUR | Extracts the hour number (from 0 to 23) for a given time or timestamp. |
| LAST_DAY | Returns the last day of the month for the specified date or timestamp. |
| MINUTE | Extracts the minute number (from 0 to 59) for a given time or timestamp. |
| MONTH | Extracts the month number (from 1 to 12) for a given date or timestamp. |
| MONTHS_BETWEEN | Returns the number of months between two date or timestamp values. |
| NEXT_DAY | Returns the date or timestamp of the first specified day of week that occurs after the input date. |
| QUARTER | Extracts the quarter number (from 1 to 4) for a given date or timestamp. |
| SECOND | Extracts the second number (from 0 to 59) for a given date or timestamp. |
| TIMESTAMPADD | Add (or subtract) an interval of time from a date/timestamp value or column. |
| TIMESTAMPDIFF | Return the amount of time between two date or timestamp values |
| TO_DATE | Converts the input expressions to the corresponding date. |
| TO_TIME | Converts the input expressions to the corresponding time. |
| TO_TIMESTAMP | Converts the input expressions to the corresponding timestamp. |
| UNIX_TIMESTAMP | Returns the Unix epoch time representation of an ISO 8601 timestamp. |
| WEEK | Extracts the week number (from 0 to 53) for a given date or timestamp. |
| WEEKOFYEAR | Returns the week of year of the date or timestamp. |
| YEAR | Extracts the year for a given date or timestamp. |
{{% snippet "datetime-formats-snippet.md" %}}