Subtract a DateTimeOffset that represents a specific date and time from the current DateTimeOffset in CSharp
Description
The following code shows how to subtract a DateTimeOffset that represents a specific date and time from the current DateTimeOffset.
Example
/* w w w . j ava 2s . c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset offsetDate = new DateTimeOffset(2014, 12, 3, 11, 30, 0,
new TimeSpan(-8, 0, 0));
TimeSpan duration = new TimeSpan(7, 18, 0, 0);
Console.WriteLine(offsetDate.Subtract(duration).ToString());
}
}
The code above generates the following result.