Description
Description intervals. And, these intervals are classified into 2 types, such as:seconds,minutes,hours and days.
It stores the timeframe including the MONTH and YEAR date time fields.
The following table illustrates the function name and purpose in interval datatypes.
| S.NO | Function Name | Description |
|---|---|---|
| 1 | TO_DSINTERVAL(X); | Changes the string x to INTERVAL DAY TO SECOND. |
| 2 | TO_YMINTERVAL(X); | Changes the string x to INTERVAL YEAR TO MONTH. |
| 3 | NUMTODSINTERVAL(x,interval_unit); | Changes the number x to INTERVAL DAY TO SECOND. |
| 4 | NUMTOYMINTERVAL(x,interval_unit); | Changes the number x to INTERVAL YEAR TO MONTH. |
Description number and character datatypes. The information is represented in seconds, minutes, hours, date, month, years and decades.
| S.NO | Function Name | Purpose |
|---|---|---|
| 1 | NEW_TIME; | Returns the time/day value from a period zone specified by the client. |
| 2 | NEXT_DAY(x,y); | Returns the date time of the following day after x. |
| 3 | LAST_DAY(X); | Returns the most recent day of the month. |
| 4 | ADD_MONTHS(x,y); | Adds y months to x. |
| 5 | MONTHS_BETWEEN(x,y); | Returns the number of months between x and y. |
| 6 | SYSDATE(); | Returns the present date time. |
| 7 | TRUNC(x[,unit]); | Truncates x. |
| 8 | ROUND(x[,unit]); | Rounds x; |
| S.NO | Function Name | Purpose |
|---|---|---|
| 1 | LOCALTIMESTAMP(); | Returns a TIMESTAMP consisting appropriate time in the session time zone. |
| 2 | SYSYIMESTAMP(); | Returns TIMESTAMP WITH TIME ZONE consisting the current database time along with the database time zone. |
| 3 | CURRENT_TIMESTAMP(); | Returns TIMESTAMP WITH TIME ZONE consisting the current session time along with the session time zone. |
| 4 | TO_TIMESTAMP_TZ(x,[format]); | Changes the string x to TIMESTAMP WITH TIMEZONE. |
| 5 | TO_TIMESTAMP(x,[format]); | Change the string x to TIMESTAMP. |
| 6 | SYS_EXTRACT_UTC(X); | Changes the TIMESTAMP WITH TIMEZONE x to a TIMESTAMP consisting the date and time in UTC. |
| 7 | FROM_TZ(X,time_zone); | Changes the TIMESTAMP x and time zone indicated by time_zone to a TIMESTAMP WITH TIMEZONE. |
Key Points