TO_TIMESTAMP functions are converting char of
NVARCHAR2 datatype to respectively a value of
Without providing the format of the input char,
TO_DATE will consider the provided char is compliant with the default date format.
Relying on a default configuration is a source of error because it creates a dependency between the code and the configuration of the ORACLE server
where this code is deployed.
According to the Oracle's documentation "the default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be
set explicitly by the NLS_DATE_FORMAT parameter.". It means the behaviour of the
TO_DATE function will certainly not be the expected one
if the configuration of the ORACLE server is changing.
Noncompliant Code Example
SELECT TO_DATE( 'January 15, 2018, 11:00 A.M.')
SELECT TO_DATE( 'January 15, 2018, 11:00 A.M.', 'Month dd, YYYY, HH:MI A.M.')