Develop/TroubleShooting

[python] 'time data 0000-00-00 00:00:00 doesn't match format specified' 오류

향식이 2021. 4. 1. 17:46

 situation

 

if date == '' :
	continue

시간이 null인 경우는 insert 안 하게끔 해줬으나

time data 0000-00-00 00:00:00 doesn't match format specified

이런 오류가 떴다. 

 

 reason

이유는 아직 잘 모르겠다 ,,

 

 solution

DB에 insert할 때 없는 경우, null이 아닌 0000-00-00 00:00:00로 업로드 된 것

 

따라서,

if date == '0000-00-00 00:00:00' :
	continue

이렇게 해줘야 오류를 피할 수 있다.

반응형