Share via


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)

Syntax

'Declaration
Public ReadOnly Property TimeOfDay As TimeSpan
public TimeSpan TimeOfDay { get; }
public:
property TimeSpan TimeOfDay {
    TimeSpan get ();
}
member TimeOfDay : TimeSpan with get
function get TimeOfDay () : TimeSpan

Property Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

DateTime Structure

System Namespace