TO_DATE function in Oracle

TO_DATE is one of the vital Conversion functions of Oracle. It is used to convert a string to a date. The TO_DATE function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.

Syntax:

TO_DATE ( string, format_mask, nls_language )

Parameters: string: It is used to specify the string to be converted. format_mask: It is an optional parameter which is used to specify the format to be used for conversion. nls_language: It is an optional parameter which is used to specify the nls language to be used for conversion.

Example:

TO_DATE ('062619', 'MMDDYY')

Output:

date value of June 26, 2019

Explanation: Here, a string is converted to a date in the desired format.

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