Show / Hide Table of Contents

Method FromDateTime

FromDateTime(DateTime)

Converts System.DateTime to TimeOnly. Date component is dropped in the conversion, and time component is truncated to the nearest second.

Declaration
public static TimeOnly FromDateTime(DateTime dateTime)
Parameters
Type Name Description
System.DateTime dateTime

The DateTime to convert.

Returns
Type Description
TimeOnly

A new instance of TimeOnly.

Applies to

Platforms and versions
TargetVersions
.NET Framework200.4 - 200.7
UWP200.4 - 200.7
In This Article
Back to top Copyright © 2022 Esri.