K. Turek K. Turek - 1 year ago 80
C# Question

Compare times repesented as string with colon

I have string with colon, for example

and I want to convert this to int variable. I was looking for solution in
but I don't find anything. I need that to compare two different times. Maybe is there any better way to do this?

Answer Source
var Str1 = "10:45";
var Str2 = "10:28";

if(TimeSpan.Parse(Str1) > TimeSpan.Parse(Str2) )
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download