0

While investigating this question I stumbled upon DateFormatSymbols.getLocalPatternChars(). The javadoc just says

Gets localized date-time pattern characters. For example: 'u', 't', etc.

So I was wondering how any use of this method can be made, if there is no guarantee about the returned string. For example it could return the pattern chars in decreasing order, era to second for example (as it seems to currently do in oracle JVM, see implementation of SimpleDateFormat)

Community
  • 1
  • 1
SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99

1 Answers1

0

I was pointed to the answer by reading this answer to another question.

The answer is found in the javadoc of java.text.DateFormatSymbols.localPatternChars:

Localized date-time pattern characters. For example, a locale may wish to use 'u' rather than 'y' to represent years in its date format pattern strings. This string must be exactly 18 characters long, with the index of the characters described by DateFormat.ERA_FIELD, DateFormat.YEAR_FIELD, etc. Thus, if the string were "Xz...", then localized patterns would use 'X' for era and 'z' for year.

But since those guarantees are only an implemetnation detail for oracle JVM, they could not be portable.

Community
  • 1
  • 1
SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99