Request a demo

BigQuery reference

BigQuery datetime functions

DATETIME is a civil date and time with no time zone: what a wall clock shows. Use it for local business times; use TIMESTAMP when you need an absolute point in time.

Functions in this category

FunctionWhat it does
CURRENT_DATETIMECURRENT_DATETIME() returns the current date and time as a DATETIME, the wall-clock time in UTC or in the time zone you pass: CURRENT_DATETIME('Europe/Berlin').
DATETIMEDATETIME builds a DATETIME from numbers, from a DATE and TIME, or converts a TIMESTAMP to local wall-clock time: DATETIME(ts, 'Europe/Berlin').
DATETIME_ADDDATETIME_ADD(datetime, INTERVAL n part) adds microseconds up to years to a DATETIME and returns a DATETIME.
DATETIME_DIFFDATETIME_DIFF(end, start, part) returns the number of part boundaries between two DATETIME values as INT64.
DATETIME_SUBDATETIME_SUB(datetime, INTERVAL n part) subtracts microseconds up to years from a DATETIME and returns a DATETIME.
DATETIME_TRUNCDATETIME_TRUNC(datetime, part) rounds a DATETIME down to the start of a period, such as the hour, day, week or month.
FORMAT_DATETIMEFORMAT_DATETIME(format_string, datetime) turns a DATETIME into a STRING using % elements, for example FORMAT_DATETIME('%d/%m/%Y %H:%M', dt) gives 23/11/2026 18:45.
PARSE_DATETIMEPARSE_DATETIME(format_string, string) converts a STRING to a DATETIME using % elements, such as PARSE_DATETIME('%d/%m/%Y %H:%M', '23/11/2026 18:45').

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.