This documentation is archived and is not being maintained.

DateTime.AddTicks Method

Adds the specified number of ticks to the value of this instance.

[Visual Basic]
Public Function AddTicks( _
   ByVal value As Long _
) As DateTime
public DateTime AddTicks(
 long value
public: DateTime AddTicks(
 __int64 value
public function AddTicks(
   value : long
) : DateTime;


A number of 100-nanosecond ticks. The value parameter can be positive or negative.

Return Value

A DateTime whose value is the sum of the date and time represented by this instance and the time represented by value.


Exception Type Condition
ArgumentOutOfRangeException The resulting DateTime is less than MinValue or greater than MaxValue.


This method does not change the value of this DateTime. Instead, a new DateTime is returned whose value is the result of this operation.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

DateTime Structure | DateTime Members | System Namespace | Int64 | Ticks