How to Get Current Date in BigQuery

Galaxy Glossary

How do I get the current date in BigQuery?

CURRENT_DATE() returns the current date in the session time-zone.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

What does CURRENT_DATE() do in BigQuery?

CURRENT_DATE() returns today’s calendar date as a DATE value based on the session’s default time-zone. No arguments are required, but you can supply an optional time-zone string.

How do I return today’s date in UTC?

Use CURRENT_DATE("UTC") to standardize results across analysts and scheduled jobs.

Can I store the current date in a table column?

Yes. Use INSERT … SELECT with CURRENT_DATE() to persist the value at run time. This is common for audit or snapshot tables.

How do I compare CURRENT_DATE() with a DATE column?

Filter rows where an order ships today: WHERE ship_date = CURRENT_DATE(). Both operands are DATE, so no casting is required.

How can I offset the current date?

Add or subtract days with DATE_ADD / DATE_SUB. Example: DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY) returns the date seven days ago.

Why specify a time-zone?

Data engineers often schedule pipelines in UTC while business users work in “America/New_York.” Supplying a zone guarantees deterministic dates regardless of the job’s location.

Best practice: parameterize the time-zone

Declare a query parameter @tz and use CURRENT_DATE(@tz). This keeps analytics code portable across regions and daylight-saving changes.

Why How to Get Current Date in BigQuery is important

How to Get Current Date in BigQuery Example Usage


/* Insert today’s date into a daily sales snapshot */
INSERT INTO `shop.DailySales` (snapshot_date, total_sales)
SELECT CURRENT_DATE("America/New_York"), SUM(total_amount)
FROM `shop.Orders`
WHERE order_date = CURRENT_DATE("America/New_York");

How to Get Current Date in BigQuery Syntax


-- Basic form
CURRENT_DATE()

-- With explicit time-zone
CURRENT_DATE([timezone])

-- timezone: Optional STRING literal like "UTC", "America/Los_Angeles", or an expression returning such a string.
-- Returns: DATE (YYYY-MM-DD)

/* Ecommerce example: flag orders placed today (UTC) */
SELECT id, customer_id, order_date
FROM `shop.Orders`
WHERE order_date = CURRENT_DATE("UTC");

Common Mistakes

Frequently Asked Questions (FAQs)

Does CURRENT_DATE() respect daylight saving time?

Yes, when you pass a named zone like "America/New_York", BigQuery adjusts for DST automatically.

Can I use CURRENT_DATE in a partition filter?

Absolutely. Partition pruning works when you filter on a column = CURRENT_DATE(), improving query performance.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.