Fungsi Date & Time BigQuery
Fungsi untuk bekerja dengan tanggal dan waktu. Temukan semua 35 fungsi date & time di BigQuery lengkap dengan syntax, contoh, dan penjelasan bahasa Indonesia.
35 fungsi date & time di BigQuery
← Semua fungsi BigQueryCURRENT_DATE
Returns the current date based on the specified timezone or the default timezone.
DATECURRENT_DATETIME
Returns the current datetime (date and time without timezone information) based on the specified timezone.
DATETIMECURRENT_TIME
Returns the current time (without a date) based on the specified timezone.
TIMECURRENT_TIMESTAMP
Returns the current timestamp in UTC. This is the most common way to get the current date and time in BigQuery.
TIMESTAMPDATE
Creates a DATE value from individual components, or extracts a DATE from a timestamp or datetime expression.
DATEDATETIME
Creates a DATETIME value from components, combines a DATE and TIME, or converts from a TIMESTAMP.
DATETIMEDATETIME_ADD
Adds a time interval to a DATETIME value. Supports all units from MICROSECOND to YEAR.
DATETIMEDATETIME_DIFF
Calculates the difference between two DATETIME values in the specified unit.
INT64DATETIME_SUB
Subtracts a time interval from a DATETIME value. The inverse of DATETIME_ADD.
DATETIMEDATETIME_TRUNC
Truncates a DATETIME value to the specified granularity. Supports all date parts from MICROSECOND through YEAR.
DATETIMEDATE_ADD
Adds a specified time interval to a DATE. Returns a new DATE.
DATEDATE_DIFF
Calculates the difference between two DATE values in the specified unit. Returns an integer value.
INT64DATE_SUB
Subtracts a specified time interval from a DATE. Returns a new DATE.
DATEDATE_TRUNC
Truncates a DATE to the specified granularity (DAY, WEEK, MONTH, QUARTER, YEAR).
DATEEXTRACT
Extracts a specific component from a DATE, TIME, DATETIME, or TIMESTAMP value. Returns an integer.
INT64FORMAT_DATE
Formats a DATE value into a string based on the specified format. Uses standard format elements.
STRINGFORMAT_DATETIME
Formats a DATETIME value into a string. Combines format elements for both date and time.
STRINGFORMAT_TIME
Formats a TIME value into a string based on the specified format.
STRINGFORMAT_TIMESTAMP
Formats a TIMESTAMP value into a string. Supports timezone for accurate display.
STRINGLAST_DAY
Returns the last day of the specified period (month, quarter, or year).
DATEMAKE_DATE
Membuat DATE dari komponen year, month, dan day.
DATEPARSE_DATE
Parses a string into a DATE based on the specified format. The inverse of FORMAT_DATE.
DATEPARSE_DATETIME
Converts a string into a DATETIME type based on the specified format.
DATETIMEPARSE_TIME
Converts a time string into a TIME type based on the specified format.
TIMEPARSE_TIMESTAMP
Converts a string to a TIMESTAMP type with timezone support.
TIMESTAMPTIME
Creates a TIME value from components, or extracts the TIME portion from a timestamp or datetime.
TIMETIMESTAMP
Creates a TIMESTAMP value from a string, DATE, or DATETIME. TIMESTAMP values are always stored in UTC.
TIMESTAMPTIMESTAMP_ADD
Adds a time interval to a TIMESTAMP value. The result remains in UTC.
TIMESTAMPTIMESTAMP_DIFF
Calculates the difference between two TIMESTAMP values in the specified unit. Most accurate for measuring absolute durations.
INT64TIMESTAMP_SUB
Subtracts a time interval from a TIMESTAMP value. The inverse of TIMESTAMP_ADD.
TIMESTAMPTIMESTAMP_TRUNC
Truncates a TIMESTAMP to the specified granularity. Supports timezone for accurate local-time results.
TIMESTAMPTIME_ADD
Adds a time interval to a TIME value. Useful for work-hour calculations and scheduling.
TIMETIME_DIFF
Calculates the difference between two TIME values in the specified unit.
INT64TIME_SUB
Subtracts a time interval from a TIME value. The inverse of TIME_ADD.
TIMETIME_TRUNC
Truncates a TIME value to the specified granularity (MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR).
TIME