• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customized date separator

 
Suman Mummaneni
Ranch Hand
Posts: 92
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Is there any way to get the customized date separator that has been set by the user in the windows regional settings. As the regional settings provides an option to customize the date separator and other date characters the Locale object does not retrieve the accordingly set characters it only returns the defaults of that Locale
 
Scott Selikoff
author
Saloon Keeper
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may not be the ideal solution, but if you're looking for information specific to Windows regional settings, such as Windows Local information, you can read it very easily from the Windows Registry.

All such options for the current logged in user are stored in the registry key:

HKEY_CURRENT_USER\Control Panel\International

If you use Regedit.exe to open this by hand, its not vary difficult to discern. For example, "sDate" controls the date separate, "sShortDate" controls the date format. As for how to read the data from the Windows Registry, can't really help you there, there's numerous tips and tools online for it such as http://www.rgagnon.com/javadetails/java-0480.html that I just found using Google.

Hope this helps!
 
Suman Mummaneni
Ranch Hand
Posts: 92
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Scott,

Thankyou very much for the post. I have solved the problem using JNI. I was using JNI in the project so I added new method to the dll to return windows date and time format. The solution that you have proposed is also good. It's a work around solution with out using JNI.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem, I figured there was a more elegent way, but I've never accessed the registry using java, so I'm glad you found the better way. Good luck!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic