Coding, is? Fun!

Sunday, February 25, 2007

Daylight Saving Time Patch from Microsoft breaks apps

The Microsoft patch applied by knowedge base for switching the Daylight Saving Time (DST) from April to sceond Sunday of March starting 2007 caused some damage to our applications. The MS Java Virual Machine is used by us and the Java Date string format looks like "Sunday 25 Feb 12:23:39 AM EST 2007" in an unpatched server. If we pass this to Javascript to initiate a new Date object, it works.
That is, if you did Date date = new Date() in Java and applied the toString() method on it, it renders the string with timezone as "EST".
BUT, if you patched the server with the above Microsoft patch, then the Date string looks like:
"Sunday 25 Feb 12:23:39 AM GMT - 05:00 2007". So, note that now the timezone is rendered with respect to GMT. If you pass this to Javascript, it returns NaN.
That is, some change that Microsoft made to the OS in the above DST patch seems to change the way the Java Date object renders itself as a string. I do not know if this affects the Sun JRE.
How do we fix this? As of now, Microsoft has not been talking about a fix. We plan to fix it by overriding the Date object's toString method and creating our custom one.
Relevant links are in:
One of my colleagues contacted Microsoft and they replied Microsoft had no planes to fix this patch.
There is also information for .NET applications in the above links.


Post a Comment

<< Home