C# DateTimeOffset AddTicks
Description
DateTimeOffset AddTicks
adds a specified number of ticks
to the current DateTimeOffset object.
Syntax
DateTimeOffset.AddTicks
has the following syntax.
public DateTimeOffset AddTicks(
long ticks
)
Parameters
DateTimeOffset.AddTicks
has the following parameters.
ticks
- A number of 100-nanosecond ticks. The number can be negative or positive.
Returns
DateTimeOffset.AddTicks
method returns An object whose value is the sum of the date and time represented by the current
DateTimeOffset object and the number of ticks represented by ticks.
Example
using System;//from ww w . ja v a 2 s . c o m
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset quarterDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0,
DateTimeOffset.Now.Offset);
quarterDate = quarterDate.AddTicks(3);
Console.WriteLine(quarterDate);
}
}
The code above generates the following result.