Answer the question
In order to leave comments, you need to log in
How to properly format date "Oct 06" in Java JodaTime?
There is a date "Oct 06", I tried to format it like this:
DateTime to_date = DateTimeFormat.forPattern("M d").parseDateTime(massive.get(i).date);
Exception in thread "main" java.lang.IllegalArgumentException: Invalid format: "Oct 06"
Answer the question
In order to leave comments, you need to log in
The current locale is probably Russian, so "Oct" is expected instead of " M ", not "Oct". But you can also explicitly specify the locale:
DateTimeFormat
.forPattern("M d")
.withLocale(Locale.US)
.parseDateTime(massive.get(i).date);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question