NEW_TIME function in Oracle

NEW_TIME is one of the vital Date/Time functions of Oracle. It is used to convert a date from one time zone to another. The NEW_TIME function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g and Oracle 9i.

Syntax:

NEW_TIME ( date, zone1, zone2 )

Parameters: date: It is used to specify the date. zone1: It is used to specify the original time zone of the date. zone2: It is used to specify the new desired time zone for the date.

Example 1:

NEW_TIME (TO_DATE ('2019/06/26 01:55', 'yyyy/mm/dd HH24:MI'), 'AST', 'MST')

Output:

 ‘2019/06/26 10:55:00 PM’

Explanation: The result is the date two months from the starting date.

Please follow and like us:
Content Protection by DMCA.com