C# DateTime AddTicks
Description
DateTime AddTicks
returns a new DateTime that adds the
specified number of ticks to the value of this instance.
Syntax
DateTime.AddTicks
has the following syntax.
public DateTime AddTicks(
long value
)
Parameters
DateTime.AddTicks
has the following parameters.
value
- A number of 100-nanosecond ticks. The value parameter can be positive or negative.
Returns
DateTime.AddTicks
method returns An object whose value is the sum of the date and time represented by this instance
and the time represented by value.
Example
The following code shows how to use DateTime.AddTicks
.
/* w w w . j av a2s.co m*/
using System;
public class Example
{
public static void Main()
{
DateTime dateValue = new DateTime(2013, 9, 15, 12, 0, 0);
Console.WriteLine(dateValue.AddTicks(20));
}
}
The code above generates the following result.