Solved

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

Posted on 2008-11-03
1
918 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

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:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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