Add a specified time interval to a DateTimeOffset in CSharp
Description
The following code shows how to add a specified time interval to a DateTimeOffset.
Example
using System;/* w w w. j a v a2s . co m*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset takeOff = new DateTimeOffset(2014, 6, 1, 7, 55, 0,
new TimeSpan(-5, 0, 0));
DateTimeOffset currentTime = takeOff;
currentTime = currentTime.Add(new TimeSpan(2, 25, 0));
Console.WriteLine(currentTime);
}
}
The code above generates the following result.