Request a demo

BigQuery · Date function

BigQuery DATE

DATE builds a DATE from year, month and day numbers, or converts a TIMESTAMP or DATETIME to its calendar date. DATE(ts, 'America/New_York') returns the local date of a timestamp; without a time zone it uses UTC.

GoogleSQL for BigQuery · Checked against the official reference in November 2026

DATE has three jobs. DATE(2026, 11, 23) builds a date from integers. DATE(datetime_value) drops the time from a DATETIME. DATE(timestamp_value[, time_zone]) returns the calendar date of a TIMESTAMP in a time zone, UTC by default.

The time zone matters more than it looks. An order placed at 22:30 in New York on November 22 is stored as a TIMESTAMP of 03:30 UTC on November 23, so DATE(created_at) puts it on the 23rd. Grouping daily revenue by DATE(created_at, 'America/New_York') puts it on the day the customer saw. EXTRACT(DATE FROM ts AT TIME ZONE 'America/New_York') gives the same result.

To turn a STRING into a DATE, use CAST('2026-11-23' AS DATE) for the canonical YYYY-MM-DD layout or PARSE_DATE for any other layout. DATE(2026, 2, 30) fails with "Input calculates to invalid date"; SAFE.DATE(2026, 2, 30) returns NULL instead.

Syntax

DATE(year, month, day)

DATE(timestamp_expression[, time_zone_expression])

DATE(datetime_expression)

Arguments and return value

ArgumentDescription
year, month, dayINT64 values for the calendar date to build.
timestamp_expressionA TIMESTAMP whose calendar date you want.
time_zone_expressionOptional STRING time zone for the TIMESTAMP form, such as 'Europe/Berlin' or '+05:30'. Defaults to UTC.
datetime_expressionA DATETIME; the time part is dropped.

Returns: DATE

Examples

Build a date, or take the date part

SELECT
  DATE(2026, 11, 23) AS from_parts,
  DATE(DATETIME '2026-11-23 18:45:00') AS from_datetime,
  DATE(TIMESTAMP '2026-11-23 18:45:00+00') AS from_timestamp;
Result
from_partsfrom_datetimefrom_timestamp
2026-11-232026-11-232026-11-23

Convert a timestamp to a date in a time zone

03:30 UTC is 22:30 on November 22 in New York and 12:30 on November 23 in Tokyo.

SELECT
  DATE(TIMESTAMP '2026-11-23 03:30:00+00') AS utc_date,
  DATE(TIMESTAMP '2026-11-23 03:30:00+00', 'America/New_York') AS new_york_date,
  DATE(TIMESTAMP '2026-11-23 03:30:00+00', 'Asia/Tokyo') AS tokyo_date;
Result
utc_datenew_york_datetokyo_date
2026-11-232026-11-222026-11-23

Daily orders by the customer's local day

Grouped by DATE(created_at) in UTC, the same rows would give 1 order on the 22nd and 2 on the 23rd.

WITH orders AS (
  SELECT 1 AS order_id, TIMESTAMP '2026-11-22 23:10:00+00' AS created_at UNION ALL
  SELECT 2, TIMESTAMP '2026-11-23 02:45:00+00' UNION ALL
  SELECT 3, TIMESTAMP '2026-11-23 14:00:00+00'
)
SELECT
  DATE(created_at, 'America/New_York') AS local_day,
  COUNT(*) AS orders
FROM orders
GROUP BY local_day
ORDER BY local_day;
Result
local_dayorders
2026-11-222
2026-11-231

Invalid parts: error or NULL

Without the SAFE. prefix the query fails with "Input calculates to invalid date: 2026-02-30".

SELECT SAFE.DATE(2026, 2, 30) AS feb_30;
Result
feb_30
NULL

Common mistakes

  • Taking the date of a TIMESTAMP without a time zone. DATE(ts) is the UTC date. For business reporting, pass the zone your business runs in: DATE(ts, 'Europe/Paris').
  • Passing a time zone with a DATETIME. DATE(datetime_value, 'UTC') has no matching signature: a DATETIME has no zone to convert from. Convert first with TIMESTAMP(datetime_value, 'Europe/Paris') if the value is local time.
  • Expecting DATE to parse any string. Use CAST(s AS DATE) for YYYY-MM-DD and PARSE_DATE for layouts such as 23/11/2026; a bad value fails the query unless you use SAFE_CAST or SAFE.PARSE_DATE.
  • Porting TO_DATE(s, 'YYYY-MM-DD') from Snowflake, Oracle or PostgreSQL. BigQuery has no TO_DATE; use PARSE_DATE('%Y-%m-%d', s).

Cost and performance

  • Filtering a TIMESTAMP-partitioned table with DATE(ts) = '2026-11-23' or CAST(ts AS DATE) = '2026-11-23' still prunes partitions, according to BigQuery's partition pruning guide. A time zone argument changes which partitions match, so test it with a dry run.

FAQ

How do I convert a timestamp to a date in BigQuery?

Use DATE(ts) for the UTC date or DATE(ts, 'America/Chicago') for the local date. CAST(ts AS DATE) and EXTRACT(DATE FROM ts) also return the UTC date.

How do I convert a string to a date?

CAST('2026-11-23' AS DATE) works for the YYYY-MM-DD layout. For any other layout use PARSE_DATE, for example PARSE_DATE('%d/%m/%Y', '23/11/2026').

How do I make a date from year, month and day columns?

Use DATE(year_col, month_col, day_col). All three must be INT64; wrap the call in SAFE.DATE(...) if some combinations may be invalid, such as February 30.

Errors you may hit

More date functions

All BigQuery date functions · All functions · BigQuery error messages

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.