So my cell phone rings this morning early and it's support calling to tell me that users are reporting strange errors in the application. When I have a look I find the problem is that we're comparing a date submitted via a web form to a date previously stored. The date submitted is in the format YYYYMMDDhhmm and it looks good though when I debug and look at the Calendar object created from this
string it's an hour ahead!
Somehow on DST days the clock is being pushed up one more hour than it should. This is on a Windows machine in a DST time zone (for me Montreal Eastern Standard Time).
Below is a simple program to demonstrate this problem. It seems that the Calendar add method is the culprit. If I create a calendar by setting just the date and then 'adding' the minutes it bumps an hour up. If I just set each Calendar field it works fine.
Anyone want to confirm this? This is
java 5_07 and java 6. TIA.