Handle datetime parsing errors more gracefully