fix datetime conversion + fixing postgres column case sensitivity