Date Format Question (reverts to US date format)
I live in the United Kingdon and use dates in the short date formatdd/mm/yyyy. I have an application that works perfectly with Windows XP and Windows Vista when you change the date format on a machine in the "Regional and Language Options" of the "Control Panel" the dates display properly in the application.The application was developed with Delphi 2009, I believe, in casethis makes any difference.When run under Windows 7 all the date fields show up in US format (mm/dd/yyyy) even though all the regional settings, etc. have been set correctly on the machine. Furthermore, running the application in either the Windows XP or Windows Vista emulations does not cure the problem.Is there a known issue about this in Windows 7 or/and does anyone have any ideas?Thank you
December 3rd, 2009 10:10am

Hi, Please try to run the application with Compatibility Mode and see how it works. Since this is an application developing related question, it is recommended that you try the following methods for further investigation: Delphi support: Windows 7 Development Center MSDN forum: Software Development for Windows Client Thanks. Nicholas Li - MSFT
Free Windows Admin Tool Kit Click here and download it now
December 4th, 2009 2:03pm

Hi Nicholas,Thank you for your answer.Running the application in Compatibility Mode makes no difference.However, if the application is left running for a number of hours then by moving between other applications the date format changes to the correct format. If the application is re-started the date format reverst to the US date format.This sure sounds like a Windows 7 bug to me.Thanks
December 5th, 2009 3:05pm

Hi, Thank you for your update. Considering the issue is related to application developing, it is still recommended that you contact Delphi support or our MSDN forum for further investigation. This should be more efficient. Thanks again. Nicholas Li - MSFT
Free Windows Admin Tool Kit Click here and download it now
December 7th, 2009 12:34pm

Hi,I am also having the exact same issue, but with 2 other LOB applications that we use. It's definitely correct in Regional Settings but the application fails to recognise it. One workaround I have is to change the Format under Region and Language to another language e.g. English (Canada) and then change it back again to what it should be, in my case English (Australia) and that seems to fix my issue.This workaround isn't feasible for a couple of hundred machines that will eventually be migrated to Windows 7.Infrazee, let me know if that fixes your date issue with Delphi 2009?Cheers
December 21st, 2009 3:16am

Hi, I am also having the exact same issue, but with 2 other LOB applications that we use. It's definitely correct in Regional Settings but the application fails to recognise it. One workaround I have is to change the Format under Region and Language to another language e.g. English (Canada) and then change it back again to what it should be, in my case English (Australia) and that seems to fix my issue. This workaround isn't feasible for a couple of hundred machines that will eventually be migrated to Windows 7. Infrazee, let me know if that fixes your date issue with Delphi 2009? Cheers Thanks George, worked for me as well. Good to see (not) Microsoft denying this bug, some things never change. Spent a whole weekend trying to fix problem.
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2010 1:03pm

HiHave you managed to fix the problem as I am having the same issue. ThanksRussellNewcastle-upon-tyne
February 15th, 2010 12:43am

This is a Windows 7 Bug. We have the same issue with Delphi Applications on Windows 7 with a New Zealand locale. I have done some investigation around how Delphi retrieves it's Short Date Format from the Windows OS, and it is clear that Windows 7 is not storing/saving the format correctly until you select the regional settings a second time in Windows Regional Settings and save. The issue can be easily replicated by creating an application that calls the Windows API function directly (note there are no Delphi specific functions here, only API calls): GetLocaleInfo(DefaultLCID, LOCALE_SSHORTDATE, Buffer, 255); Where Buffer is a null terminated string 255 in length LOCALE_SSHORTDATE = $0000001F DefaultLCID = GetThreadLocale() This will return 'mm/dd/yyyy' into Buffer, unless you have reselected New Zealand in the Windows Regional settings and saved for a second time. I have not investigated as to when the oringal setting (that didn't save correctly) was set, i.e during upgrade? or during new install or after install.Tim
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2010 12:20am

If you open "Regional and Language Options" from the control panel (the globe icon) / intl.cpl, and reselect your locale it will likely solve the problem. 1) Open Regional and Language Options2) Under "Format" pick anything else. (eg: English (United States)).3) Press "Apply"4) Under "Format" pick your desired locale (eg: English (United Kingdom)).5) Press OK.FWIW: Windows stores duplicate locale "name"s and "LCID"s (it's best if you use the named APIs, eg: GetLocaleInfoEx()), and they got out-of-sync when windows was installed. Rerunning intl.cpl gets them back in-sync.-Shawn
March 18th, 2010 7:31pm

This work around does work as I also mentioned in my post, it's going to have to go out as an announcement to all of our clients in case they upgrade to Windows 7. It happens on every install of Windows 7, and also happens if you have already selected the region again and then when you create a new user and log on as that user - they must reselect the region again to get the correct result. I've logged this bug with Microsoft via Microsoft Premier, just be interesting if we get a fix for those outside of the US. :-)Tim
Free Windows Admin Tool Kit Click here and download it now
March 19th, 2010 3:30am

Hey TBurrows, Your fix has saved the day for our NZ clients rolling out new Win7 servers. Our application was showing the wrong format and we could not work out why? Your fix is nice and easy but should be fixed by MS. Cheers Rob
April 27th, 2010 3:15am

I have a similar issue. In Excel 2007 and MS-Money 2005, fields that previously displayed dd-mmm-yy data formats now shows as d-mm-yy or dd-mm-yy (02-Jun-10 now displays 02-06-10 or 2-06-10) I've checked all Language and Region settings, changed them to English(Canada) and then reset them back to English(Australia), but that did not work. I have 100's of spreadsheets that I use professionally (as well as for my customers). In Excel, I can manually change the format back to dd-mmm-yy, but it would take days to change it on all spreadsheets. Cheers, P-F
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2010 5:32am

Have similar issue with Regional Options: One of our apps displays Euros instead of Dollars. Reason: -French version of Win7 out of box(France locale) -They change to French Canada -The old locale seems to stay -Have to manually re-apply French-canada locale (as per Shawn's workaround) We have hundreds of clients and have to manually re-apply oursleves...been doing it for months...I guess 'Windows 7 was(n't) my idea' after all.... All puns aside I do hope there's going to be a patch soon.
June 24th, 2010 8:50pm

Hi Tim I just had the same issu as you (also doing Delphi development). If you wish to avoid your users to do the workaround themselves, use the following unit as the first in your project: unit Win7; interface uses SysUtils, Windows; implementation initialization SetThreadLocale(LOCALE_USER_DEFAULT); GetFormatSettings; end. HTH Søren
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2010 11:29am

Hi there, i had exactly the same issue. It was changing my £ to $ and my date was in the wrong format. I have managed to change it by simply changing to english (US) and back to english (uk) Thank you so much! I have been struggling with this for 2 months!
January 13th, 2011 7:32am

Hi All, I'm also experiencing the same problem with the decimal separator. I have an older delphi 5 application and some users reported errors when running in windows 7 environment. From my custom error logs I can see the issue is with converting a strToFloat and that the decimal separator is not being returned correctly. I have tried various windows 7 editions, professional/Home/Enterprise, 32 bit and 64 bit but to date I have not been able to replicate the error. Has anyone been able to determine the specific conditions that this will occur? So far this suggested work around appears to be working for my users, I would like to look at using the additional code lines suggested but unless I can replicate the error I can't confirm if the extra lines are of any benefit. Has this been recognised as an official bug by Microsoft? Thanks in advance for any info KD
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2011 3:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics