Use the Parse() method to convert strings to TimeSpan instances: 8:10:30 : TimeSpan Parse « Date Time « C# / CSharp Tutorial






using System;

class MainClas
{
  public static void Main()
  {
    
    TimeSpan myTimeSpan11 = TimeSpan.Parse("8:10:30");
    Console.WriteLine("TimeSpan.Parse(\"8:10:30\") = " + myTimeSpan11);
  }
}
TimeSpan.Parse("8:10:30") = 08:10:30








13.6.TimeSpan Parse
13.6.1.Use the Parse() method to convert strings to TimeSpan instances: 8:10:30
13.6.2.Use the Parse() method to convert strings to TimeSpan instances: 1.8:10:30.1234567