Date Format in Windows

Is it possible to get the date format from windows locale setting?I'm using Java 1.6 and the date format instance for SHORT is not the same as windows locale setting.
[181 byte] By [o00oo00oa] at [2007-11-26 16:31:21]
# 1
Am not exactly sure what you are asking for here but are you aware that it is possible to specify the Locale when you create the formatting object?
Tillermana at 2007-7-8 22:55:52 > top of Java-index,Java Essentials,Java Programming...
# 2
Yes, however what I want is to be able to get the date format from windows OS setting.look at Windows Control Panel > Regional and Language Option > Customize > Date tab > here you will see the date format.I set my OS setting to dd/MM/yyyy, Java setting is
o00oo00oa at 2007-7-8 22:55:52 > top of Java-index,Java Essentials,Java Programming...
# 3

Ah, I see now, sorry.

Must admit that I do not know the answer to this question. I always thought that Java assumed a 'standardised default' for each Locale and did not actually take any account of the platforms settings. Also, I do not think that the language exposes this information anywhere; I have not conducted an exhaustive search but cannot find anything in the System and Toolkit classes that would seem to give you access to this setting.

It may be worthwhile searching to see where this setting is exposed throuhg the win32API. That way, you could always write native code to read the setting, access that using JNI and then make use of the setting. That would still leave one problem IMO; what would you do if the user changed the Windows date setting? Alternatively, you could use a ResourecBudnel to parameterise the date string. That would be far easier to implement and allow the user to establish their own (horror) defaults - assuming this is acceptable given the requirements of the application.

Tillermana at 2007-7-8 22:55:52 > top of Java-index,Java Essentials,Java Programming...
# 4
I think I'll just make the application to be able to store user date format setting, instead of reading from the OS setting.Thanks for the help.
o00oo00oa at 2007-7-8 22:55:52 > top of Java-index,Java Essentials,Java Programming...