BigQuery

Fungsi SQL BigQuery

Data warehouse serverless dari Google Cloud. 35 fungsi tersedia.

Menampilkan 24 dari 35 fungsi dalam kategori Date & Time

CURRENT_DATE

Date & Time

Returns the current date based on the specified timezone or the default timezone.

Tipe hasil: DATE

CURRENT_DATETIME

Date & Time

Returns the current datetime (date and time without timezone information) based on the specified timezone.

Tipe hasil: DATETIME

CURRENT_TIME

Date & Time

Returns the current time (without a date) based on the specified timezone.

Tipe hasil: TIME

CURRENT_TIMESTAMP

Date & Time

Returns the current timestamp in UTC. This is the most common way to get the current date and time in BigQuery.

Tipe hasil: TIMESTAMP

DATE

Date & Time

Creates a DATE value from individual components, or extracts a DATE from a timestamp or datetime expression.

Tipe hasil: DATE

DATETIME

Date & Time

Creates a DATETIME value from components, combines a DATE and TIME, or converts from a TIMESTAMP.

Tipe hasil: DATETIME

DATETIME_ADD

Date & Time

Adds a time interval to a DATETIME value. Supports all units from MICROSECOND to YEAR.

Tipe hasil: DATETIME

DATETIME_DIFF

Date & Time

Calculates the difference between two DATETIME values in the specified unit.

Tipe hasil: INT64

DATETIME_SUB

Date & Time

Subtracts a time interval from a DATETIME value. The inverse of DATETIME_ADD.

Tipe hasil: DATETIME

DATETIME_TRUNC

Date & Time

Truncates a DATETIME value to the specified granularity. Supports all date parts from MICROSECOND through YEAR.

Tipe hasil: DATETIME

DATE_ADD

Date & Time

Adds a specified time interval to a DATE. Returns a new DATE.

Tipe hasil: DATE

DATE_DIFF

Date & Time

Calculates the difference between two DATE values in the specified unit. Returns an integer value.

Tipe hasil: INT64

DATE_SUB

Date & Time

Subtracts a specified time interval from a DATE. Returns a new DATE.

Tipe hasil: DATE

DATE_TRUNC

Date & Time

Truncates a DATE to the specified granularity (DAY, WEEK, MONTH, QUARTER, YEAR).

Tipe hasil: DATE

EXTRACT

Date & Time

Extracts a specific component from a DATE, TIME, DATETIME, or TIMESTAMP value. Returns an integer.

Tipe hasil: INT64

FORMAT_DATE

Date & Time

Formats a DATE value into a string based on the specified format. Uses standard format elements.

Tipe hasil: STRING

FORMAT_DATETIME

Date & Time

Formats a DATETIME value into a string. Combines format elements for both date and time.

Tipe hasil: STRING

FORMAT_TIME

Date & Time

Formats a TIME value into a string based on the specified format.

Tipe hasil: STRING

FORMAT_TIMESTAMP

Date & Time

Formats a TIMESTAMP value into a string. Supports timezone for accurate display.

Tipe hasil: STRING

LAST_DAY

Date & Time

Returns the last day of the specified period (month, quarter, or year).

Tipe hasil: DATE

MAKE_DATE

Date & Time

Membuat DATE dari komponen year, month, dan day.

Tipe hasil: DATE

PARSE_DATE

Date & Time

Parses a string into a DATE based on the specified format. The inverse of FORMAT_DATE.

Tipe hasil: DATE

PARSE_DATETIME

Date & Time

Converts a string into a DATETIME type based on the specified format.

Tipe hasil: DATETIME

PARSE_TIME

Date & Time

Converts a time string into a TIME type based on the specified format.

Tipe hasil: TIME