Request a demo

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

FunctionWhat it does
CURRENT_DATECURRENT_DATE() returns today's date as a DATE, in UTC unless you pass a time zone: CURRENT_DATE('America/New_York').
DATEDATE builds a DATE from year, month and day numbers, or converts a TIMESTAMP or DATETIME to its calendar date.
DATE_ADDDATE_ADD(date, INTERVAL n part) adds days, weeks, months, quarters or years to a DATE and returns a DATE.
DATE_BUCKETDATE_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_DIFFDATE_DIFF(end_date, start_date, DAY) returns the number of days between two dates as INT64.
DATE_FROM_UNIX_DATEDATE_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_SUBDATE_SUB(date, INTERVAL n part) subtracts days, weeks, months, quarters or years from a DATE.
DATE_TRUNCDATE_TRUNC rounds a date down to the start of a period: DATE_TRUNC(order_date, MONTH) returns the first day of that month.
EXTRACTEXTRACT(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_DATEFORMAT_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_ARRAYGENERATE_DATE_ARRAY(start, end[, INTERVAL n part]) returns an ARRAY of dates from start to end, both included.
LAST_DAYLAST_DAY(date) returns the last day of the month that contains a date, such as 2026-11-30 for 2026-11-23.
PARSE_DATEPARSE_DATE(format_string, string) converts a STRING to a DATE using % elements, such as PARSE_DATE('%d/%m/%Y', '23/11/2026').
UNIX_DATEUNIX_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

Observability for every BigQuery table, in about 15 minutes

Masthead detects freshness, volume and schema anomalies, monitors pipeline errors and maps column-level lineage across all your projects, from logs and metadata only.