How to make sure NLS_DATE_FORMAT is correct and set to "YYYY-MM-DD HH24:MI:SS"
Resolution
Run the following SQL queries against your database:
select 1 as id, parameter, value from nls_database_parameters where parameter = 'NLS_DATE_FORMAT' union select 2 as id, parameter, value from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT'
Log as sysdba and then run this query:
alter system set nls_date_format="yyyy-mm-dd hh24:mi:ss" scope=spfile;