Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I haven't heard about any Java date formatter that uses MS Windows formatting routines (or just definitions for that matter). Since Java is meant to be multiplatform (compile once, run anywhere), it simply couldn't use underlying OS behavior, for consistency reasons.</p> <p>You can use DateFormat class as defined <a href="http://download.oracle.com/javase/tutorial/i18n/format/dateFormat.html" rel="nofollow">here</a>:</p> <pre><code>DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()); String formattedDate = dateFormatter(new Date()); </code></pre> <p>One important issue about this class: LONG date formats are broken for Czech, Polish and Russian, possibly for other Slavic languages too. I recommend using MEDIUM date format instead.</p> <p>BTW. This will format dates for Gregorian or Julian calendars. It won't give you Arabic nor Hebrew calendars (although former is default for some countries).</p> <hr> <p><strong>Edit</strong></p> <p>I am not aware of your specific requirements, but since you mentioned Locale, maybe <a href="http://icu-project.org/apiref/icu4j/" rel="nofollow">ICU4J's</a> <a href="http://icu-project.org/apiref/icu4j/com/ibm/icu/text/DateFormat.html" rel="nofollow">DateFormat</a> class is what you looking for. Still, as per my knowledge (which might be incomplete here), they are using their own formatter and localized text database. However, this database is probably more complete (especially on Mac) than the one bundled with JDK (previous ICU snapshot).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload