Solved

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

12 Experts available now in Live!

Get 1:1 Help Now