Method FromTimeSpan
FromTimeSpan(TimeSpan)
Converts 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 |
---|---|---|
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 |