Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DateTimeOffset::DateTime Property

 

Gets a DateTime value that represents the date and time of the current DateTimeOffset object.

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

public:
property DateTime DateTime {
	DateTime get();
}

Property Value

Type: System::DateTime

The date and time of the current DateTimeOffset object.

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

This property returns both the date and the time component of a DateTimeOffset object, which makes it useful for performing DateTimeOffset to DateTime conversion. For example, if the DateTimeOffset object has a date and time value of "1/12/07 4:01pm + 7:30", the property returns a date of "1/12/07 4:01pm".

The value of the DateTime::Kind property of the returned DateTime object is DateTimeKind::Unspecified.

The following example illustrates the use of the DateTime property to convert the time returned by the Now and UtcNow properties to DateTime values.

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

Universal Windows Platform
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
Return to top
Show:
© 2017 Microsoft