ORA-01861: literal does not match format string

탱귤생귤·2023년 5월 24일

ERROR

목록 보기
2/33

My code that ran perfectly in my accademy computer kept saying I have ORA-01861: literal does not match format string error.

This was because Korea's Date default format is "yyyy-mm-dd", but US's format is different. Accademy's format is Korea, and my laptop's is US. So this made the error.

I had to use to_date(contentDate,'yyyy-mm-dd') and it worked.

I did

String sql= "select contentTime from contentTime where contentDate=to_date(?,'yyyy-mm-dd');

0개의 댓글