1

Is is possible to format a date like 25 May MON (not 25 May Mon)? Or do I have to format the date twice ("d MMM" and "EEE"), then call uppercase for the second string and then join them?

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
user924
  • 8,146
  • 7
  • 57
  • 139
  • 1
    Personally I would use [`DateTimeFormatterBuilder.appendText(TemporalField, Map)`](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/time/format/DateTimeFormatterBuilder.html#appendText(java.time.temporal.TemporalField,java.util.Map)) to build a formatter that would format the day of week abbreviation in all uppercase. But yes, another option is to have two `DateTimeFormatter`s, uppercase the string from one of them and concatenate the results. – Ole V.V. Apr 20 '23 at 18:38
  • 1
    See [my answer to a similar question here](https://stackoverflow.com/a/51240496/5772882). – Ole V.V. Apr 20 '23 at 18:47
  • 4
    Yet an alternative would be `String.format(Locale.ENGLISH, "%te % – Ole V.V. Apr 20 '23 at 19:06
  • Is all-uppercase the norm in the particular culture in which you are interested? If so, say so. Then we might be able to get your desired result via `Locale` class. – Basil Bourque Apr 27 '23 at 19:02

0 Answers0