BigQuery reference
BigQuery date functions
DATE functions in BigQuery (GoogleSQL) build, shift, truncate, compare and format calendar dates. A DATE has no time and no time zone, so it is the right type for daily partitions, reporting days and anything you group by calendar day.
Functions in this category
| Function | What it does |
|---|---|
| CURRENT_DATE | CURRENT_DATE() returns today's date as a DATE, in UTC unless you pass a time zone: CURRENT_DATE('America/New_York'). |
| DATE | DATE builds a DATE from year, month and day numbers, or converts a TIMESTAMP or DATETIME to its calendar date. |
| DATE_ADD | DATE_ADD(date, INTERVAL n part) adds days, weeks, months, quarters or years to a DATE and returns a DATE. |
| DATE_BUCKET | DATE_BUCKET(date, INTERVAL n DAY) returns the first day of the fixed-width bucket that contains a date, counted from an origin (1950-01-01 by default). |
| DATE_DIFF | DATE_DIFF(end_date, start_date, DAY) returns the number of days between two dates as INT64. |
| DATE_FROM_UNIX_DATE | DATE_FROM_UNIX_DATE(n) converts a count of days since 1970-01-01 into a DATE: DATE_FROM_UNIX_DATE(20780) is 2026-11-23. |
| DATE_SUB | DATE_SUB(date, INTERVAL n part) subtracts days, weeks, months, quarters or years from a DATE. |
| DATE_TRUNC | DATE_TRUNC rounds a date down to the start of a period: DATE_TRUNC(order_date, MONTH) returns the first day of that month. |
| EXTRACT | EXTRACT(part FROM value) returns one part of a DATE, DATETIME, TIMESTAMP or TIME, such as YEAR, MONTH, DAYOFWEEK, ISOWEEK or HOUR, usually as INT64. |
| FORMAT_DATE | FORMAT_DATE(format_string, date) turns a DATE into a STRING using % elements: FORMAT_DATE('%d/%m/%Y', d) gives 23/11/2026 and FORMAT_DATE('%B %Y', d) gives November 2026. |
| GENERATE_DATE_ARRAY | GENERATE_DATE_ARRAY(start, end[, INTERVAL n part]) returns an ARRAY of dates from start to end, both included. |
| LAST_DAY | LAST_DAY(date) returns the last day of the month that contains a date, such as 2026-11-30 for 2026-11-23. |
| PARSE_DATE | PARSE_DATE(format_string, string) converts a STRING to a DATE using % elements, such as PARSE_DATE('%d/%m/%Y', '23/11/2026'). |
| UNIX_DATE | UNIX_DATE(date) returns the number of days since 1970-01-01 as INT64: UNIX_DATE(DATE '2026-11-23') is 20780. |
More of the BigQuery reference
Datetime functionsTimestamp functionsString functionsAggregate functionsWindow functionsArray functionsJSON functionsConversion functionsConditional expressionsMathematical functionsHash and utility functionsQuery syntaxDDL statementsDML statementsScripting and data movementINFORMATION_SCHEMAError messagesBigQuery pricingPricing calculator
