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 BigQueryReturns the current date based on the specified timezone or the default timezone.
DATEReturns the current datetime (date and time without timezone information) based on the specified timezone.
DATETIMEReturns the current time (without a date) based on the specified timezone.
TIMEReturns the current timestamp in UTC. This is the most common way to get the current date and time in BigQuery.
TIMESTAMPCreates a DATE value from individual components, or extracts a DATE from a timestamp or datetime expression.
DATECreates a DATETIME value from components, combines a DATE and TIME, or converts from a TIMESTAMP.
DATETIMEAdds a time interval to a DATETIME value. Supports all units from MICROSECOND to YEAR.
DATETIMECalculates the difference between two DATETIME values in the specified unit.
INT64Subtracts a time interval from a DATETIME value. The inverse of DATETIME_ADD.
DATETIMETruncates a DATETIME value to the specified granularity. Supports all date parts from MICROSECOND through YEAR.
DATETIMEAdds a specified time interval to a DATE. Returns a new DATE.
DATECalculates the difference between two DATE values in the specified unit. Returns an integer value.
INT64Subtracts a specified time interval from a DATE. Returns a new DATE.
DATETruncates a DATE to the specified granularity (DAY, WEEK, MONTH, QUARTER, YEAR).
DATEExtracts a specific component from a DATE, TIME, DATETIME, or TIMESTAMP value. Returns an integer.
INT64Formats a DATE value into a string based on the specified format. Uses standard format elements.
STRINGFormats a DATETIME value into a string. Combines format elements for both date and time.
STRINGFormats a TIME value into a string based on the specified format.
STRINGFormats a TIMESTAMP value into a string. Supports timezone for accurate display.
STRINGReturns the last day of the specified period (month, quarter, or year).
DATEMembuat DATE dari komponen year, month, dan day.
DATEParses a string into a DATE based on the specified format. The inverse of FORMAT_DATE.
DATEConverts a string into a DATETIME type based on the specified format.
DATETIMEConverts a time string into a TIME type based on the specified format.
TIMEConverts a string to a TIMESTAMP type with timezone support.
TIMESTAMPCreates a TIME value from components, or extracts the TIME portion from a timestamp or datetime.
TIMECreates a TIMESTAMP value from a string, DATE, or DATETIME. TIMESTAMP values are always stored in UTC.
TIMESTAMPAdds a time interval to a TIMESTAMP value. The result remains in UTC.
TIMESTAMPCalculates the difference between two TIMESTAMP values in the specified unit. Most accurate for measuring absolute durations.
INT64Subtracts a time interval from a TIMESTAMP value. The inverse of TIMESTAMP_ADD.
TIMESTAMPTruncates a TIMESTAMP to the specified granularity. Supports timezone for accurate local-time results.
TIMESTAMPAdds a time interval to a TIME value. Useful for work-hour calculations and scheduling.
TIMECalculates the difference between two TIME values in the specified unit.
INT64Subtracts a time interval from a TIME value. The inverse of TIME_ADD.
TIMETruncates a TIME value to the specified granularity (MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR).
TIME