Kind Property

DateTime.Kind Property

 

Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither.

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

member Kind : DateTimeKind with get

Property Value

Type: System.DateTimeKind

One of the enumeration values that indicates what the current time represents. The default is Unspecified.

You can explicitly set the Kind property of a new DateTime value to a particular DateTimeKind value by calling the SpecifyKind method.

The Kind property allows a DateTime value to clearly reflect either Coordinated Universal Time (UTC) or the local time. In contrast, the DateTimeOffset structure can unambiguously reflect any time in any time zone as a single point in time.

The following example uses the SpecifyKind method to demonstrate how the Kind property influences the ToLocalTime and ToUniversalTime conversion methods.

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft