DateTimeOffset::UtcDateTime Property
Gets a DateTime value that represents the Coordinated Universal Time (UTC) date and time of the current DateTimeOffset object.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System::DateTimeThe Coordinated Universal Time (UTC) date and time of the current DateTimeOffset object.
The UtcDateTime property performs a dual conversion:
It converts the date and time of the current DateTimeOffset object to Coordinated Universal Time (UTC). The conversion is performed by subtracting the value of the Offset property from the date and time of the current DateTimeOffset object.
It converts the DateTimeOffset value to a DateTime value.
The Kind property of the returned DateTime value is set to DateTimeKind::Utc.
Retrieving the value of the UtcDateTime property is equivalent to calling the current DateTimeOffset object's ToUniversalTime.DateTime property, except that the Kind property of the latter DateTime value is DateTimeKind::Unspecified.
The following example shows how to use of the UtcDateTime property to display a DateTimeOffset value and its corresponding UTC time.
Available since 8
.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