DateTimeKind 列舉


指定 DateTime 物件是否表示本地時間、Coordinated Universal Time (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
public enum DateTimeKind
type DateTimeKind = 
type DateTimeKind = 
Public Enum DateTimeKind


Local 2

表示的時間為本地時間。The time represented is local time.

Unspecified 0

表示的時間既未指定為本地時間,也未指定為 Coordinated Universal Time (UTC)。The time represented is not specified as either local time or Coordinated Universal Time (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.