Raise a type mismatch if a time can't be serialized