Is there any way to get the time and date format from the ‘Language & Text’ setting on Mac OS x in Java code? If not in Java, can that be done without using cocoa framework?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there’s no support for this in the standard Java API. The closest match for your need is probably the
DateFormat.getInstance()which gives you the default date format for the default locale on your system.For the specific format in the Language & Text settings you would have to rely on some native library for solving this.
I can however definitely see the usefulness of such library, so if you decide to go through with it I encourage you to make it open source and let people add support for more operating systems.