DateTimeOffset::TimeOfDay Property

 

Gets the time of day for the current DateTimeOffset object.

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

public:
property TimeSpan TimeOfDay {
	TimeSpan get();
}

Property Value

Type: System::TimeSpan

The time interval of the current date that has elapsed since midnight.

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

The TimeOfDay property returns the time component of a DateTimeOffset object in the form of a TimeSpan object. It is equivalent to the DateTime::TimeOfDay property.

The following example uses the TimeOfDay property to extract the time and display it to the console.

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: