If all you need to do is print the date according to the default locale of the system, just use the simplest DateFormat.getInstance() factory method. The DateFormat instance you'll get will use the default Locale... by default you may want to specify the style of the displayed date (short/medium/long/full), though, then you have to use on of the factory methods: getDateInstance or getDateTimeInstance, specifying the chosen format.
Sarath Koiloth Ramath
Joined: May 07, 2008
Thanks for the replies.
I tried the above help.Could not find out the desired result.
I will repeat my problem:
I am creating a desktop application which will be used in different contries.So i want to get the current system timezone(i know how to get the timezone).So using this timezone i need to change the date in my application.
For eg:If i am using in US the it should come like mm/dd/yyyy if i am using it in india the it should come like dd/mm/yy It the format depands on the timezone selected by the user.
There isn't a function that maps timezones to standard date formats. So you'll have to find some other way.
Although I believe Dariusz Kordonski has given you the right answer. Have you actually tested your application in different countries to see if it does what you want? If so, and if it doesn't do what you want, what does it do differently?