Subtracts a DateTimeOffset from another DateTimeOffset : DateTimeOffset Calculation « Date Time « C# / C Sharp






Subtracts a DateTimeOffset from another DateTimeOffset

Subtracts a DateTimeOffset from another DateTimeOffset
  

using System;
using System.Globalization;
public class Test
{
   public static void Main()
   {  
        DateTimeOffset offsetDate = new DateTimeOffset(2010, 12, 3, 11, 30, 0, new TimeSpan(-8, 0, 0)); 
        TimeSpan duration = new TimeSpan(7, 18, 0, 0);
        Console.WriteLine(offsetDate.Subtract(duration).ToString());
   }
}

   
    
  








Related examples in the same category

1.Adds a specified time interval to a DateTimeOffset object.
2.Adds a specified number of whole and fractional days to the current DateTimeOffset object.
3.Add one week to the current date
4.Adds a specified number of whole and fractional hours to the current DateTimeOffset object.
5.Adds a specified number of months to the current DateTimeOffset object.
6.Adds a specified number of years to the DateTimeOffset object.
7.DateTimeOffset Greater Than OperatorDateTimeOffset Greater Than Operator
8.DateTimeOffset Greater Than Or Equal OperatorDateTimeOffset Greater Than Or Equal Operator
9.DateTimeOffset Inequality OperatorDateTimeOffset Inequality Operator
10.DateTimeOffset LessThan OperatorDateTimeOffset LessThan Operator
11.DateTimeOffset Less Than Or Equal OperatorDateTimeOffset Less Than Or Equal Operator
12.Subtracts a time interval from DateTimeOffsetSubtracts a time interval from DateTimeOffset
13.Converts DateTimeOffset to local time.Converts DateTimeOffset to local time.
14.Gets a DateTime value that represents the Coordinated Universal Time (UTC) date and time from DateTimeOffset