It’s been asked on the mailing list and the answer is that it is not possible because the original pattern is not retained.
The same thread suggests using a DateTimeFormatterBuilder
which does have the information.
More Related Contents:
- UnsupportedTemporalTypeException when formatting Instant to String
- Unable to obtain ZonedDateTime from TemporalAccessor using DateTimeFormatter and ZonedDateTime in Java 8
- How to parse/format dates with LocalDateTime? (Java 8)
- Convert java.util.Date to java.time.LocalDate
- Converting between java.time.LocalDateTime and java.util.Date
- Calculate days between two Dates in Java 8
- Unable to obtain LocalDateTime from TemporalAccessor when parsing LocalDateTime (Java 8)
- Difference between year-of-era and week-based-year?
- Any difference between java.time.Clock.systemDefaultZone().getZone() vs java.util.TimeZone.getDefault().toZoneId()?
- How to get milliseconds from LocalDateTime in Java 8
- JPA support for Java 8 new date and time API
- JDK dateformatter parsing DayOfWeek in German locale, java8 vs java9
- Unit testing a class with a Java 8 Clock
- How can I create a Java 8 LocalDate from a long Epoch time in Milliseconds?
- Differences between Java 8 Date Time API (java.time) and Joda-Time
- Mocking time in Java 8’s java.time API
- Convert between LocalDate and sql.Date [duplicate]
- Formatting a Duration in Java 8 / jsr310
- Exception when trying to parse a LocalDateTime
- Why can’t I get a duration in minutes or hours in java.time?
- How to extract epoch from LocalDate and LocalDateTime?
- Unable to obtain OffsetDateTime from TemporalAccessor
- How can I parse/format dates with LocalDateTime? (Java 8)
- How to set format of string for java.time.Instant using objectMapper?
- String to ZonedDateTime is changing format
- Format a date using the new date time API
- DateTimeFormatter Support for Single Digit Day of Month and Month of Year
- Java 8 LocalDate – How do I get all dates between two dates?
- How to serialize and deserialize Java 8’s java.time types with Gson? [closed]
- What’s the difference between ZonedDateTime and OffsetDateTime?