This one as well as the solutions posted will stay in my mind, since indeed Regional settings have propably costed me most troubles as a programmer.
Not only the switch of date data, but also the decimal seperator.
I once wrote a weekstatistic producing module in visual basic. I wrote and installed it after the 12th day of a certain month. Everything went perfect between the 13th and the 31th, but once it became the first of the next month ... the statistics went mad. In Belgium we normally use dd/mm/yyyy but since the day after 31/07/2005 became 08/01/2005 -it's a strange world- I started using yyyy-mm-dd everywhere where possible, not only in code, but also in text, in filenames, ... because yyyy-mm-dd always seem to sort logically, also in numerical and alphanumerical (non date) data types.
In Belgium we use comma instead of points to seperate decimal data. This is even worse since I've experienced some of our financial data being multiplied and sometimes being divided with factor 100 while using 2 decimals. So we can pass a VB datatype double to a stored procedure accepting a decimal data type without problem, but when I paste the same double in a query build on the fly inside my VB-code (I know it's not by the book) we have to cast to strings and replace points and commas. This is fine as long as none of our users find out the meaning of the meaning of NL/EN icon in the taskbar and as long as nobody by accident presses CTRL-ALT-SHIFT causing locales switching.
Perhaps we'd better always check the current regional settings in our code when using decimal and date data.
We've also experienced big regional setting troubles on website level till we found out our website users inherit regional settings from a specific windows account, which might have other regional settings than the accounts we use to log in, to develop and to maintain our servers.
My whoop of this week, not bad either :
I wrote a lot of queries, including table dropping, truncate table, ... and executed them on a test database. I saved all the queries together in one .sql file. Afterwards I wanted to execute SOME of those queries on our life database. At once we (after some users reporting strange things) dedected empty tables, we saw new tables which shouldn't be there, ...
At the first moment I thought we'd been hacked, but than when I started analyzing all "strange" things in our database I realized I must have pressed F5 in the query analyzer, while no specific query was selected. So from now on I put the following statement at top of all my .sql files ...
loop while 1 = 1
Now, when the red icon says "execution in progress", I no longer have to fear I've pressed F5 by accident. I no longer fear top quality Keyla cleaning my unlocked keyboard while I'm looking for thea in the kitchen.
We can't blame Microsoft there are different defaults, can we?
Kind Regards, Peter Van Wilrijk.