DateTimeKind DateTimeKind DateTimeKind DateTimeKind Enum

定義

指定 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
[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

表示的時間既未指定為本地時間,也未指定為 Coordinated Universal Time (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.

適用於