Method FromTimeSpan
FromTimeSpan(TimeSpan)
Converts System.TimeSpan to TimeOnly.
Only timespans between 0 and +24 hours are supported, and sub-second precision is lost.
Declaration
public static TimeOnly FromTimeSpan(TimeSpan timeSpan)
Parameters
Type |
Name |
Description |
System.TimeSpan |
timeSpan |
The TimeSpan to convert.
|
Returns
Type |
Description |
TimeOnly |
A new instance of TimeOnly.
|
Exceptions
Type |
Condition |
System.ArgumentOutOfRangeException |
|
Applies to
Platforms and versions
Target | Versions |
.NET Framework | 200.4 - 200.6 |
UWP | 200.4 - 200.6 |