Create a TimeSpan instance, specifying the hours, minutes, and seconds : TimeSpan : Date Time C# Examples


C# Examples » Date Time » TimeSpan »

 

Create a TimeSpan instance, specifying the hours, minutes, and seconds









    
using  System;

class  MainClas
{
    public  static  void  Main()
    {
        
        int  hours  =  4;
        int  minutes  =  12;
        int  seconds  =  10;
        TimeSpan  myTimeSpan  =  new  TimeSpan(hours,  minutes,  seconds);
        Console.WriteLine("myTimeSpan  =  "  +  myTimeSpan);
    }
}
    
   
  
   



Output

myTimeSpan = 04:12:10


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Date Time
» TimeSpan