NEW_TIME
NEW_TIME is a date function in Oracle SQL, used to convert a date and time from one time zone to another. Specifically, it allows conversions between Eastern Standard Time and Pacific Standard Time.
NEW_TIME(date, from_tz, to_tz)
- date: This parameter represents the timestamp or datetime value that you want to convert. It is a mandatory parameter which should contain a valid timestamp value.
- from_tz: Specifies the timezone of the ‘date’ parameter. This is also a mandatory argument which refers to the current timezone of the provided ‘date’.
- to_tz: This last parameter indicates the target timezone to which you want to convert the specified ‘date’. It is also a required argument and must contain a valid timezone identifier.
Example
Output
Explanation
The NEW_TIME function converts a date from one time zone to another. In the provided code, the function NEW_TIME is taking a date in ‘EST’ (Eastern Standard Time) and converting it into ‘PST’ (Pacific Standard Time).