Why the time field is showing invalid time error?