java DateTimeFormatterBuilder fails on testtime [duplicate]

The month name is in English, so you’d better set a java.util.Locale in the formatter.

If you don’t set it, the formatter will use the JVM default locale. And if it’s not English, you might get an error (and different environments might have different configurations, so it’s better to set the locale instead of relying on the JVM’s default).

Just do toFormatter(Locale.ENGLISH) instead of just toFormatter() and that’s it.

Leave a Comment