How to Convert string “07:35” (HH:MM) to TimeSpan
While correct that this will work: TimeSpan time = TimeSpan.Parse(“07:35”); And if you are using it for validation… TimeSpan time; if (!TimeSpan.TryParse(“07:35”, out time)) { // handle validation error } Consider that TimeSpan is primarily intended to work with elapsed time, rather than time-of-day. It will accept values larger than 24 hours, and will accept … Read more