Solved

How does System.TimeZoneInfo.TransitionTime calculate the Week property for a floating daylight savings rule?

Posted on 2008-11-03
1
911 Views
Last Modified: 2013-12-17
I'm busy writing a service that will detect daylight savings change overs and execute code when this change over happens. (for any daylight savings enabled timezone).
I understand that there are two types of transition time rules. Fixed: where Month, Day and Time of day are used for the rule. Floating: where month, week, dayOfWeek and Time of day are used.

I'm having trouble with the way that .net is reporting the Week property for a floating rule.
From what i can see Month 11, week 1, DayOfWeek sunday = the first sunday in November.

If it is the first sunday it reports the week as 1, that i can understand, but if it is the last sunday (forth sunday) it reports 5 but there are only 4 sundays in the month. How does .net calculate the week property?

How do i generate a DateTime using the floating rule properties?

Here is what i was using when i first found this inconsistancy.
The timezone is "(GMT-08:00) Tijuana, Baja California"
DayLight Start DateTime : 05 April 2009 2AM (reports the correct week value)
DayLight End Datetime : 25 October 2009 2AM (reports week 5 ???)


0
Comment
Question by:Caroline_Swart
1 Comment
 
LVL 20

Accepted Solution

by:
Juan_Barrera earned 500 total points
ID: 22866030
Hi Caroline,
Not sure if it helps, you may have seen it already, but, if not, check this link: http://msdn.microsoft.com/en-us/library/system.timezoneinfo.transitiontime.createfloatingdaterule.aspx
 
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now