Use the Add() method to add a TimeSpan instance to another : TimeSpan : Date Time C# Examples


C# Examples » Date Time » TimeSpan »

 

Use the Add() method to add a TimeSpan instance to another









    
using  System;

class  MainClas
{
    public  static  void  Main()
    {
        TimeSpan  myTimeSpan13  =  new  TimeSpan(1,  10,  13);
        TimeSpan  myTimeSpan14  =  new  TimeSpan(2,  6,  10);
        TimeSpan  myTimeSpan15  =  myTimeSpan13.Add(myTimeSpan14);
        Console.WriteLine("myTimeSpan13  =  "  +  myTimeSpan13);
        Console.WriteLine("myTimeSpan14  =  "  +  myTimeSpan14);
        Console.WriteLine("myTimeSpan15  =  "  +  myTimeSpan15);
    }
}
    
   
  
   



Output

myTimeSpan13 = 01:10:13
myTimeSpan14 = 02:06:10
myTimeSpan15 = 03:16:23


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Date Time
» TimeSpan