TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime Struct

定義

提供某時區中之特定時間變更的相關資訊,例如從日光節約時間變更為標準時間,或從標準時間變更為日光節約時間。Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone.

public: value class TimeZoneInfo::TransitionTime : IEquatable<TimeZoneInfo::TransitionTime>, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
[System.Serializable]
public struct TimeZoneInfo.TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
type TimeZoneInfo.TransitionTime = struct
    interface ISerializable
    interface IDeserializationCallback
Public Structure TimeZoneInfo.TransitionTime
Implements IDeserializationCallback, IEquatable(Of TimeZoneInfo.TransitionTime), ISerializable
繼承
TimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTime
屬性
實作

備註

您可以使用TimeZoneInfo.TransitionTime結構表示從標準時間到日光節約時間,或從回標準時間,日光節約時間轉換發生時。You can use the TimeZoneInfo.TransitionTime structure to indicate when a transition from standard time to daylight saving time, or from daylight saving time back to standard time, occurs. 此結構支援固定日期規則和浮動日期規則。This structure supports both fixed-date rules and floating-date rules. 使用固定日期規則 (例如上午 2:00 在特定月份的特定日期發生的時間轉換Use fixed-date rules for time transitions that occur on a specific day of a specific month (such as 2:00 A.M. 11 月 3 日)。on November 3). (例如上午 2:00 特定月份特定週特定一天發生的時間轉換使用浮動日期規則Use floating-date rules for time transitions that occur on a specific day of a specific week of a specific month (such as 2:00 A.M. 第一個星期日年 11 月)。on the first Sunday of November).

下表比較固定日期和浮動日期轉換中使用的內容:The following table compares the properties used in fixed-date and floating-date transitions:

月份Month 一週Week DayDay 時間Time
固定日期規則Fixed-date rule Month N/AN/A Day TimeOfDay
浮動日期規則Floating-date rule Month Week DayOfWeek TimeOfDay

固定日期和浮動日期轉換TimeOfDay屬性會取得發生時間變更的時間。For both fixed-date and floating-date transitions, the TimeOfDay property gets the time at which the time change occurs. 從標準轉換到日光節約時間,這是時區標準時間值。For transitions from standard to daylight saving time, this is the time zone's standard time value. 從日光節約標準時間轉換,這是時區的日光節約時間值。For transitions from daylight saving to standard time, this is the time zone's daylight saving time value. 這是DateTime值會略過其日期元件,其年、 月和日值必須一律等於 1。This is a DateTime value whose date component is ignored; its year, month, and day value must always equal 1.

注意

執行個體TimeZoneInfo.TransitionTime結構是不變。An instance of the TimeZoneInfo.TransitionTime structure is immutable. 一旦建立物件之後,就無法修改其值。Once an object has been created, its values cannot be modified.

ATimeZoneInfo.TransitionTime可以建立物件,藉由呼叫static(Shared在 Visual Basic 中)CreateFixedDateRuleCreateFloatingDateRule分別建立固定或浮動日期規則的方法。A TimeZoneInfo.TransitionTime object can be created by calling the static (Shared in Visual Basic) CreateFixedDateRule and CreateFloatingDateRule methods to create a fixed or floating-date rule, respectively. 開始和結束TimeZoneInfo.TransitionTime物件做為參數,然後提供CreateAdjustmentRule方法用來建立新的調整規則來包含這項轉換時間資訊。The starting and ending TimeZoneInfo.TransitionTime objects are then supplied as parameters to the CreateAdjustmentRule method to create a new adjustment rule that includes this transition time information.

DaylightTransitionStartDaylightTransitionEnd的屬性TimeZoneInfo.AdjustmentRule物件傳回TimeZoneInfo.TransitionTime物件。The DaylightTransitionStart and DaylightTransitionEnd properties of an TimeZoneInfo.AdjustmentRule object return a TimeZoneInfo.TransitionTime object.

屬性

Day Day Day Day

取得發生時間變更的日期。Gets the day on which the time change occurs.

DayOfWeek DayOfWeek DayOfWeek DayOfWeek

取得發生時間變更的當週日次。Gets the day of the week on which the time change occurs.

IsFixedDateRule IsFixedDateRule IsFixedDateRule IsFixedDateRule

取得值,指出時間變更發生在固定日期和時間 (例如 11 月 1 日) 或是浮動日期和時間 (例如 10 月的最後一個星期日)。Gets a value indicating whether the time change occurs at a fixed date and time (such as November 1) or a floating date and time (such as the last Sunday of October).

Month Month Month Month

取得發生時間變更的月份。Gets the month in which the time change occurs.

TimeOfDay TimeOfDay TimeOfDay TimeOfDay

取得發生時間變更的時、分和秒。Gets the hour, minute, and second at which the time change occurs.

Week Week Week Week

取得發生時間變更的當月週次。Gets the week of the month in which a time change occurs.

方法

CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32)

定義使用固定日期規則的時間變更 (也就是在特定月份的特定日期發生的時間變更)。Defines a time change that uses a fixed-date rule (that is, a time change that occurs on a specific day of a specific month).

CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek)

定義使用浮動日期規則的時間變更 (也就是在特定月份特定星期的特定日期發生的時間變更)。Defines a time change that uses a floating-date rule (that is, a time change that occurs on a specific day of a specific week of a specific month).

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷物件的值是否與目前 TimeZoneInfo.TransitionTime 物件的值相等。Determines whether an object has identical values to the current TimeZoneInfo.TransitionTime object.

Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime)

判斷目前 TimeZoneInfo.TransitionTime 物件的值是否與第二個 TimeZoneInfo.TransitionTime 物件的值相等。Determines whether the current TimeZoneInfo.TransitionTime object has identical values to a second TimeZoneInfo.TransitionTime object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為雜湊函式,用於雜湊演算法和資料結構,例如雜湊資料表。Serves as a hash function for hashing algorithms and data structures such as hash tables.

運算子

Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime)

判斷指定的兩個 TimeZoneInfo.TransitionTime 物件是否相等。Determines whether two specified TimeZoneInfo.TransitionTime objects are equal.

Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime)

判斷指定的兩個 TimeZoneInfo.TransitionTime 物件是否相等。Determines whether two specified TimeZoneInfo.TransitionTime objects are not equal.

明確介面實作

IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object)

在物件完成還原序列化時執行。Runs when the deserialization of an object has been completed.

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

SerializationInfo 物件中填入將這個物件序列化時所需的資料。Populates a SerializationInfo object with the data that is required to serialize this object.

適用於