Add a specified number of whole and fractional days to the current DateTimeOffset in CSharp

Description

The following code shows how to add a specified number of whole and fractional days to the current DateTimeOffset.

Example


using System;//w ww  . j av a  2 s . co  m

public class MainClass{
  public static void Main(String[] argv){  
    DateTimeOffset workDay = new DateTimeOffset(2014, 3, 1, 9, 0, 0, 
                       DateTimeOffset.Now.Offset);
    workDay = workDay.AddDays(1);
    Console.WriteLine("   {0:dddd}, {0:MMMM}{0: d}", workDay);
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var