Parse a TimeSpan greater than 24 hours?

Gadget

New Member
I have this function:\[code\] public static decimal Hours(string s) { return (decimal)TimeSpan.Parse(s).TotalHours + 0.005M; }\[/code\]The format is Hours:Minutes, ex: 30:20, or 10:17. It fails if I write give it say 25:03 or 30:20 since it is over 24 hours. Is there a way I can have it parse something > 23:59 ?Simply put, if my string is 30:30, this function needs to return 30.5.
 
Back
Top