Solved

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

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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