I\'m using .NET framework v 3.5 and i need to parse a string representing a timespan into TimeSpan object.
TimeSpan
The problem is that
If the TimeSpan format is Twelve Hour time format like this "9:00 AM", then use TimeSpan.ParseExact method with format string "h:mm tt", like this
TimeSpan ts = DateTime.ParseExact("9:00 AM", "h:mm tt", CultureInfo.InvariantCulture).TimeOfDay;
Thanks.