The i18n Cookbook - recipies for a global society

  • java cookbook
  • about the author
Home

Java Cookbook

  • Java Internationalization Cookbook

date pattern

Get the best date format pattern

 Problem:

You know what parts of a date you want to display but you don't know the exact pattern to use.

Solution:

Often a Java programmer will know what type of pattern he wants, but not exactly what the pattern would be.  With icu4j's DateTimePatternGenerator you can specify a pattern skeleton, and it will return the most appropriate localized match.

 

To get the best pattern for the skeleton, "MMMddYYYYH" in Japanese:

//Get a Locale object

  • date pattern
  • DateTimePatternGenerator
  • Add new comment
  • Read more

If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.

This site is ad supported.  I hope you find something among our sponsors worth clicking. ;)

i18n search

Google
Custom Search
Syndicate content

Search

Tags in Tags

calendar date icu4j Java Locale number format numberformat parse spellout timezone transliteration transliterator
more tags

User login

  • Create new account
  • Request new password
  • java cookbook
  • about the author