อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


TimeOnly.FromDateTime(DateTime) Method

Definition

Constructs a TimeOnly object from a DateTime representing the time of the day in this DateTime object.

C#
public static TimeOnly FromDateTime(DateTime dateTime);

Parameters

dateTime
DateTime

The DateTime object to extract the time of the day from.

Returns

A TimeOnly object representing time of the day specified in the DateTime object.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET 6, 7, 8, 9, 10