Date and time functions
This section describes the following date and time functions:
ADD_TIME_ZONE_OFFSET
: Add a timezone offset to a date. The timezone offset can be in any of the standard formats accepted by Java's ZoneId.of method (America/New_York, +02:00, etc.)DATE
: Casts String to DateDATE_ADD
: Adds an interval value of type unit to timestamp. Subtraction can be performed by using a negative valueDATE_DIFF
: Returns timestamp2 - timestamp1 expressed in terms of unitDATE_TRUNC
: Truncate a date to a given unitDAY
: Returns the day of the month from timestampDAY_OF_WEEK
: Returns the ISO day of the week from timestamp. values range from 1 (Monday) to 7 (Sunday).DAY_OF_YEAR
: Returns the day of the year from timestamp. values range from 1 to 366.EXTRACT_TIMESTAMP
: Convert a date or timestamp string to a date or timestamp, autodetecting the date format.FORMAT_DATETIME
: Convert datetime into stringFROM_ISO8601_DATE
: Parses the ISO 8601 formatted string into a dateFROM_UNIXTIME
: Convert epoch seconds to a timestampHOUR
: Returns the hour of the day from timestamp. values range from 0 to 23.MILLISECOND
: Returns the millisecond of the second from timestampMINUTE
: Returns the minute of the hour from timestampMONTH
: Returns the month of the year from timestampQUARTER
: Returns the quarter of year from timestamp. Values range from 1 to 4.RUN_END_TIME
: gets the job's execution end timeRUN_START_TIME
: gets the job's execution start timeSECOND
: Returns the second of the minute from timestampSUBTRACT_TIME_ZONE_OFFSET
: Subtract a timezone offset from a date. The timezone offset can be in any of the standard formats accepted by Java's ZoneId.of method (America/New_York, +02:00, etc.)TO_UNIXTIME
: Convert a date to its Epoch (unix) seconds representation, with fractional millisecondsTO_UNIX_EPOCH_MILLIS
: Convert a date to it's Epoch (unix) seconds representationTO_UNIX_EPOCH_SECONDS
: Convert a date to it's Epoch (unix) seconds representationYEAR_OF_WEEK
: Returns the year of ISO week from timestampYEAR
: Returns the year from timestamp
Last updated