EQL provides functions for working with time, dateTime, and duration data types.
EQL supports normal arithmetic operations between these data types.
All aggregation functions can be applied on these types except for SUM, which cannot be applied to time or dateTime types.
Function | Return Data Type | Purpose |
---|---|---|
CURRENT_TIMESTAMP
SYSTIMESTAMP |
dateTime
dateTime |
Constants representing the current date and time (at an arbitrary point during query evaluation) in GMT and server time zone, respectively. |
CURRENT_DATE
SYSDATE |
dateTime
dateTime |
Constants representing current date (at an arbitrary point during query evaluation) in GMT and server time zone, respectively. |
TO_TIME
TO_DATETIME TO_DURATION |
time
dateTime duration |
Constructs a timestamp representing time, date, or duration, using an expression. |
EXTRACT | integer | Extracts a portion of a dateTime value, such as the day of the week or month of the year. |
TRUNC | dateTime | Rounds a dateTime value down to a coarser granularity. |
TO_TZ
FROM_TZ |
dateTime
dateTime |
Returns the given timestamp in a different time zone. |
Note that using CURRENT_DATE, CURRENT_TIMESTAMP, SYSDATE, or SYSTIMESTAMP affects performance because those functions are not cached. The other functions in the table are cached.
Operation | Return Data Type |
---|---|
time (+|-) duration | time |
dateTime (+|-) duration | dateTime |
time - time | duration |
dateTime - dateTime | duration |
duration (+|-) duration | duration |
duration (*|/) double | duration |
duration /duration | double |