开发者

How to find out the actual times when DST starts/ends for a timezone and particular year?

开发者 https://www.devze.com 2023-01-24 02:08 出处:网络
I want to know the exact time when DST starts/ends in a particular timezone and year. Using TimeZoneInfo.GetAdjust开发者_JAVA技巧mentRules and AdjustmentRule.DaylightTransitionStart I can get a Trans

I want to know the exact time when DST starts/ends in a particular timezone and year.

Using TimeZoneInfo.GetAdjust开发者_JAVA技巧mentRules and AdjustmentRule.DaylightTransitionStart I can get a TransitionTime object which specifies the DST start moment rule.

Let's assume that I find the adjustment rule that applies for 2010. How do I convert it's TransitionTime object to a DateTime in 2010?

Timezone: (UTC-05:00) Eastern Time (US & Canada)
Valid: 01.01.2007 00:00:00 - 31.12.9999 00:00:00
DST Start TransitionTime:
    IsFixedDateRule: false
    Month: 3
    Week: 2
    DayOfWeek: Sunday
    TimeOfDay: 02:00:00


MSDN has the sample. See DisplayTransitionInfo function at the bottom.

0

精彩评论

暂无评论...
验证码 换一张
取 消