TimeZone.GetDaylightChanges(Int32) 方法

定義

傳回特定年份的日光節約時期。

public:
 abstract System::Globalization::DaylightTime ^ GetDaylightChanges(int year);
public abstract System.Globalization.DaylightTime GetDaylightChanges (int year);
abstract member GetDaylightChanges : int -> System.Globalization.DaylightTime
Public MustOverride Function GetDaylightChanges (year As Integer) As DaylightTime

參數

year
Int32

日光節約時期套用的年份。

傳回

DaylightTime 物件,包含 year 中的日光節約時間開始與結束日期。

例外狀況

year 小於 1 或大於 9999。

備註

每年僅支援一個日光節約時間週期。

如果日光節約時間未用於目前時區,則傳回值為 DaylightTime 物件,其中 和 End 的值 StartDateTime.MinValue ,而 的值 DaylightTime.DeltaTimeSpan 初始化為 0 刻度。

給呼叫者的注意事項

因為 類別 TimeZone 只支援一個日光節約時間調整規則,所以 GetDaylightChanges(Int32) 不論調整規則是否實際套用到該年份,方法都會將目前的調整規則套用至任何年份。 假設作業系統本身具有特定年份的精確資料,使用 方法所 GetAdjustmentRules() 傳回的物件陣列 TimeZoneInfo.AdjustmentRule ,即可取得更精確的結果。 StartEndDelta 屬性會對應至 DateStartDateEndDaylightDelta 屬性。

適用於

另請參閱