How to parse string like 30:15 to TimeSpan in C#? 30:15 means 30 hours and 15 minutes.
string span = \"30:15\"; TimeSpan ts = TimeSpan.FromHours( Convert
If you're certain that the format will always be "HH:mm" then try something like this:
string span = "35:15"; TimeSpan ts = new TimeSpan(int.Parse(span.Split(':')[0]), // hours int.Parse(span.Split(':')[1]), // minutes 0); // seconds