This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm working on an application that has been upgraded from Websphere 5.1 to 6.1, and everything looks fine except the showing of dates. Including in the Websphere update is also a change in the used JDK - from 1.4 to 1.5 (or 5.0).
The dates used to be shown in the the pattern "dd-MM-yyyy", but after the upgrade, they are shown as "yyyy-MM-dd".
Can anybody tell me why this have happened?
The default Locale has been set to "da_DK". Can anybody tell me where the "definition" of the different Locales can be found?
It's very hard to tell, because we haven't seen your code, so we don't know how you were putting those dates on screen before you made the change. Were you just using toString() on java.util.Date objects?
It shouldn't really matter what the code looks like. I was expecting my code to work exactly the same way before and after the upgrade from Websphere 5.1 to 6.1 (and jdk 1.4 to 1.5) - but it didn't! Note that nothing was changed during the upgrade. The code, data base and property files were exactly the same.
The code used DateFormat.getDateInstance() and the default Locale was set to da_DK. While debugging (in WAS 6.1), I found the date pattern stored for DateFormat was 'yyyy-MM-dd', and thus this was the format of the parsed dates. My theori is that this date pattern definition must have changed from jdk 1.4 to 1.5, but I can't find any documentation on this. I suppose it could be a change in the Locale definition for da_DK, but I don't know where to find these definitions.
Joined: May 07, 2008
My settings have been set to use the danish settings - which is dd-mm-yyyy.