In this code you can learn that there is a way to convert a 24 Hour time formatted string to a TimeSpan.
C# Code:
1 2 3 4 5 6 7 8 9 10 11 12 | class Program { static void Main(string[] args) { TimeSpan time = TimeSpan.Parse("10:30"); Console.WriteLine(time); Console.ReadLine(); } } |
how to convert string to timespan in c#