TimeOfDay Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the time of day for this instance.

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

public TimeSpan TimeOfDay { get; }

Property Value

Type: System..::..TimeSpan
A time interval that represents the fraction of the day that has elapsed since midnight.

Unlike the Date property. which returns a DateTime value that represents a date without its time component, the TimeOfDay property returns a TimeSpan value that represents a DateTime value's time component.

If you want to display the time of day or retrieve the string representation of the time of day of a DateTime value, you can instead call an overload of the ToString method that has a format parameter or use the composite formatting feature with the "t" or "T" standard format string.