Converting a String to a TimeSpan using C#
Wondering how to convert to convert a String to a Timespan.. See below for an example snippet.
(or)
TimeSpan myTimeSpan = TimeSpan.Parse(myString); |
TimeSpan myTimeSpan; if (TimeSpan.TryParse(myString, out myTimeSpan)) { // Do something } or
returns 05:00 PMDateTime.ParseExact is returning DateTime Edited: Include CultureInfo
|
Comments