This documentation is archived and is not being maintained.

DateTimeOffset.Ticks Property

Gets the number of ticks that represents the date and time of the current DateTimeOffset object in clock time.

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

member Ticks : int64

Property Value

Type: System.Int64
The number of ticks in the DateTimeOffset object's clock time.

The Ticks property is not affected by the value of the Offset property.

The value of the Ticks property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001 (the value of MinValue). It does not include ticks that would be added by leap seconds. A nanosecond is one billionth of a second; there are ten million ticks in a second. The value of the Ticks property ranges from DateTimeOffset.MinValue.Ticks to DateTimeOffset.MaxValue.Ticks.

You can assign the number of ticks to a DateTimeOffset object by using the DateTimeOffset(Int64, TimeSpan) constructor overload.

The following example initializes a DateTimeOffset object by approximating the number of ticks in the date July 1, 2008 1:23:07. It then displays the date and the number of ticks represented by that date to the console.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.