Home > Microsoft .Net Development Tips > .NET Developer > The Daylight Savings Time change and the .NET Framework
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

The Daylight Savings Time change and the .NET Framework


Ed Tittel, Contributor
05.15.2007
Rating: --- (out of 5)


.NET Essentials Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


The Daylight Savings Time switch earlier this year did more than throw off Outlook calendars. The .NET Framework needed a bit of a tweak to accommodate the change. This tip looks at what has changed and what it means in the future.

In 2005, the U.S. Congress passed the Energy Policy Act of 2005. Among its many articles, it included a change to the start and end dates for Daylight Savings Time starting this spring. For those of you who didn't notice, daylight savings took effect three weeks earlier and will end one week later than normal this year.

I myself wondered why Microsoft included a daylight savings time patch among its priority updates until I learned that the rules for Daylight Savings Time were changing as a result of this legislation. (Until then, I steadfastly refused to apply that patch, as I'm sure many others also did who weren't aware that Congress had changed the rules of the daylight savings game.) As the name of governing legislation should suggest, the idea is to save energy by pushing daylight forward earlier and backward later, so as to make the most of the sun's light when it's available to us in North America.

What many may not stop to notice is that the .NET Framework has to bend to accommodate this legislative innovation, too, which means that everybody should be aware that the rules of the timing game have changed, and that the date and time capabilities of Windows must also change to follow suit.

As it happens, .NET gets its time zone and time information from the OS, so changing Windows is necessary to make the .NET Framework get things right. In that vein, the System.TimeZone and System.DateTime classes automatically will only reflect these rule changes, if the underlying (and necessary) Windows updates are applied to the operating systems on which the framework runs.
More on DST and the .NET Framework
How .NET developers can address the DST change

Orcas (the beta version of the next and upcoming version of Visual Studio) addresses this dependency by including a TimeZone2 .NET Framework class that supports serialization and deserialization of time zone data. This permits explicit application of one or more adjustment rules. So in the future, this year's problem shouldn't plague developers, who must currently rely on end-user application of patches so that notions of time are correct in the machines on which their code runs.

This also means that C++ developers who use the TZ (timezone) variable in their applications will get outdated daylight savings time information in their applications in 2007 and the future thereafter (in that the Daylight Savings Time information that this variable returns conforms to the old set of rules rather than the new ones). Microsoft is working on a fix to this problem, and will post information when it becomes available on the Visual Studio Support pages.

In the long term, upgrading to Orcas will address this problem because it builds in sensitivity to the rules that apply to calculations that require sensitivity to daylight savings time, and is even smart enough to apply the right rules to the time frames to which they apply. Those who often stop to consider that "their time is not their own" may regard this old aphorism a bit more ruefully in the future, as they have to change their applications to match the new rules for when time springs forward and falls back!

Ed Tittel is a writer and trainer whose interests include XML and development topics, along with IT Certification and information security. E-mail etittel@techtarget.com with comments, questions, or suggested topics or tools to review. Cool tools rule!

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
.NET Developer
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Microsoft webcast series previews new Visual Studio 2010 features
New features in Windows 7 bring new UI considerations for developers
User Account Control (UAC): How to develop code for standard users
Introduction to Vista's user account control (UAC) for developers
Visual Studio 2008 code metrics tools will help keep code clean
Downloadable MSDN library released for VS 2008 SP 1
Widgetbox provides good example of how to use Facebook Developer Toolkit

.NET Framework 2.0 and Visual Studio 2005 development
Mono 2.0 moves .NET apps to Linux - includes migration analyzer
Using the Visual Studio 2005 DataSet Designer to build a data access layer
SCM Visual Studio plug-in offers updated interface
Assembly versioning in the .NET Framework 2.0
SearchVB.com's Podcast Page
Visual Studio 2008 Learning Guide: Multi-targeting
On managing a .NET Framework 1.x migration
Case Study: IdeaBlade DevForce object mapping
Book excerpt: Printing in Visual Basic 2005
CodeGear RAD Studio now supports .NET 2.0

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
IronRuby  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts