I am trying to parse some dates, but the DateTimeParser seems to disagree with me on what is valid
import java.time.ZonedDateTime
import java.time.format.Dat
a
expects either PM
or AM
in upper case. To get a case insensitive formatter you need to build it manually:
DateTimeFormatter fmt = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.appendPattern("EEE MMM dd, yyyy h:mma z")
.toFormatter(Locale.US);
Note that you will get a new error because the 16th of July is not a Wednesday.
It turns out this solution also resolves trying to parse mixed-case months (e.g., "Jul") using "MMM".