Method FromDateTime
FromDateTime(DateTime)
Converts System.DateTime to DateOnly. Only year, month, and day are used and any time-related information is lost in the conversion.
Declaration
public static DateOnly FromDateTime(DateTime dateTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | dateTime |
Returns
| Type | Description |
|---|---|
| DateOnly |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Framework | 200.4 - 200.8 |
| UWP | 200.4 - 200.8 |