1

The java.time.format.TextStyle enum has the following options:

/**
 * Full text, typically the full description.
 * For example, day-of-week Monday might output "Monday".
 */
FULL(Calendar.LONG_FORMAT, 0),
/**
 * Full text for stand-alone use, typically the full description.
 * For example, day-of-week Monday might output "Monday".
 */
FULL_STANDALONE(Calendar.LONG_STANDALONE, 0),

My question is: what is a difference between FULL and FULL_STANDALONE - what does "for stand-alone" use mean?

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
  • 1
    Not knowing the full story, in some languages the *genitive* form of a month name is used with day of month, a bit like when in English we say *22 of March* sometimes. If you are mentioning the month without day of month, you don’t want to say *of March* but just *March*, which in such languages you do by using the *nominative* form of the month name instead. So `FULL_STANDALONE` gives you the nominative while `FULL` gives you the genitive. – Ole V.V. Mar 22 '23 at 09:12
  • 1
    There’s some information here: https://cldr.unicode.org/translation/date-time/date-time-patterns Scroll down to **When to use Standalone vs. Formatting**. Also a related question here: [Difference between MMM and LLL (Stand alone value) in SimpleDateFormat object](https://stackoverflow.com/questions/45398202/difference-between-mmm-and-lll-stand-alone-value-in-simpledateformat-object) (while no one should use `SimpleDateFormat` anymore, the answer is valid to java.time too). – Ole V.V. Mar 22 '23 at 09:22

0 Answers0