Fixed an error when the time format is invalid