0

I have a requirement where I need the pattern ICU uses to format the given date/time.

For example: If I have something like DateFormat.getDateInstance(DateFormat.SHORT, en_US).format(currentDate) gives me 5/3/2015, then I need an API which can tell me that the pattern ICU4J internally using is d/M/yyyy.

halfer
  • 19,824
  • 17
  • 99
  • 186
MAmateur
  • 139
  • 2
  • 9

1 Answers1

0

I did figure out a solution, all you need to do is convert the DateFormat into a SimpleDateFormat and call toPattern().

((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT, en_US)).toPattern() returns d/M/y which is what I almost needed.

MAmateur
  • 139
  • 2
  • 9