ORA-01818: ‘HH24’ precludes use of meridian indicator

ORA-01818: ‘HH24’ precludes use of meridian indicator

Oracle PL/SQL error message: ORA-01818: ‘HH24’ precludes use of meridian indicator.

Cause:

A date specification contained both a 24-hour time format code and a meridian indicator code. If hours are specified using the 24-hour time format (HH24), a meridian indicator, AM or PM, may not be specified.

Solution:

Remove the meridian indicator format code, AM/PM or A.M./P.M., or the 24-hour time format code, HH24, from the date specification.

Example 1:

SELECT TO_DATE('30-DEC-2015 11:25', 'DD-MON-YYYY HH24:MI PM') FROM dual;

Output:

ORA-01818: ‘HH24’ precludes use of meridian indicator

Correct:

SELECT TO_DATE('30-DEC-2015 11:25', 'DD-MON-YYYY HH24:MI') FROM dual;

Output:

30-DEC-2015 11:25:00