DateTimeKind DateTimeKind DateTimeKind DateTimeKind Enum


指定 DateTime 对象是表示本地时间、协调通用时间 (UTC),还是既不指定为本地时间,也不指定为 UTC。Specifies whether a DateTime object represents a local time, a Coordinated Universal Time (UTC), or is not specified as either local time or UTC.

public enum class DateTimeKind
public enum DateTimeKind
type DateTimeKind = 
Public Enum DateTimeKind


Local Local Local Local 2

表示的时间为本地时间。The time represented is local time.

Unspecified Unspecified Unspecified Unspecified 0

表示的时间既未指定为本地时间,也未指定为协调通用时间 (UTC)。The time represented is not specified as either local time or Coordinated Universal Time (UTC).

Utc Utc Utc Utc 1

表示的时间为 UTC。The time represented is UTC.


DateTimeKind枚举的成员DateTime.Kind由属性返回。A member of the DateTimeKind enumeration is returned by the DateTime.Kind property.

DateTimeKind枚举的成员用于本地时间与协调世界时 (UTC) 之间的转换操作, 但不用于比较或算术运算。The members of the DateTimeKind enumeration are used in conversion operations between local time and Coordinated Universal Time (UTC), but not in comparison or arithmetic operations. 有关时间转换的详细信息, 请参阅在时区之间转换时间For more information about time conversions, see Converting Times Between Time Zones.