Share via


DateTime.AddTicks Method

Adds a specified number of ticks to the current DateTime object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public DateTime AddTicks (
         longval
)

Parameters

  • val
    A specific number of ticks (one tick equals 100 nanoseconds). Note that the number in the val parameter can be either positive or negative.

Return Value

A new DateTime object having a value that represents the sum of the current DateTime object and the specified number of ticks.

Remarks

This method does not change the value of the current DateTime object; rather, it returns a new DateTime object.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

DateTime Structure
DateTime Members
System Namespace