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
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
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.

适用于