Add a specified number of whole and fractional seconds to the current DateTimeOffset in CSharp
Description
The following code shows how to add a specified number of whole and fractional seconds to the current DateTimeOffset.
Example
using System;/* w w w . j a v a 2s .c om*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset quarterDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0,
DateTimeOffset.Now.Offset);
quarterDate = quarterDate.AddSeconds(3);
Console.WriteLine(quarterDate);
}
}
The code above generates the following result.