To convert a string to LocalDateTime in Java, we call LocalDateTime.parse(). A LocalDateTime is a date and a time of day with no time zone. With one argument, parse() reads the standard ISO format, such as 2026-10-04T10:15:30. For any other layout, we describe the layout with a DateTimeFormatter, which we build with ofPattern(), and pass it as the second argument.
We parse strings to LocalDateTime whenever a date and a time reach our code as text, such as a booking time from a web form or a timestamp column in a CSV file.
The following example parses an ISO string, a custom pattern, a 12-hour time and a date-only string, with the result of each line as a comment.
LocalDateTime a = LocalDateTime.parse("2026-10-04T10:15:30"); // 2026-10-04T10:15:30
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
LocalDateTime b = LocalDateTime.parse("04-10-2026 10:15", formatter); // 2026-10-04T10:15
DateTimeFormatter amPm = DateTimeFormatter.ofPattern("dd-MM-yyyy hh:mm a", Locale.ENGLISH);
LocalDateTime c = LocalDateTime.parse("04-10-2026 10:15 PM", amPm); // 2026-10-04T22:15
LocalDateTime d = LocalDate.parse("2026-10-04").atStartOfDay(); // 2026-10-04T00:00
Notice that the 12-hour pattern gets a Locale, because the AM/PM marker is a word in a language, and that the date-only string goes through LocalDate.
Next, we look at which strings the ISO format accepts and how to write our own patterns, and then handle AM/PM, month names, time zones, date-only strings, strict checks, and the common error messages with their fixes.
1. Parse String to LocalDateTime
LocalDateTime has two static parse() methods.
- LocalDateTime.parse(CharSequence text) reads the ISO-8601 format (the international standard layout yyyy-MM-ddTHH:mm:ss).
- LocalDateTime.parse(CharSequence text, DateTimeFormatter formatter) reads the layout that the formatter describes.
Both methods return a new, immutable LocalDateTime object. When the text does not match the format, both methods throw DateTimeParseException, and when the text is null, they throw NullPointerException with the message “text”.
1.1. Default Pattern yyyy-MM-ddTHH:mm:ss
When we pass only the text, Java uses the ready-made formatter DateTimeFormatter.ISO_LOCAL_DATE_TIME, which expects three parts in the text.
- The date part (ISO_LOCAL_DATE), for example 2026-10-04.
- The letter ‘T’, which separates the date from the time. Parsing ignores the case of this letter, so ‘t’ works as well.
- The time part (ISO_LOCAL_TIME), for example 10:15 or 10:15:30.123.
Hours and minutes are required, with two digits each. Seconds and the fraction of a second are optional, and the fraction can have 1 to 9 digits, so fractions down to nanoseconds parse without a pattern.
LocalDateTime noSeconds = LocalDateTime.parse("2026-10-04T10:15"); // 2026-10-04T10:15
LocalDateTime seconds = LocalDateTime.parse("2026-10-04T10:15:30"); // 2026-10-04T10:15:30
LocalDateTime millis = LocalDateTime.parse("2026-10-04T10:15:30.123"); // 2026-10-04T10:15:30.123
LocalDateTime nanos = LocalDateTime.parse("2026-10-04T10:15:30.123456789"); // 2026-10-04T10:15:30.123456789
LocalDateTime lowerT = LocalDateTime.parse("2026-10-04t10:15:30"); // 2026-10-04T10:15:30
The most common failure is a space in place of the T. Strings with a one-digit hour or a missing time fail too, and so does a string that ends with an offset (a suffix such as Z or +05:30 that says how far the time is from UTC).

1.2. Custom Patterns
For any other layout, we write a pattern, build a DateTimeFormatter from it, and pass the formatter as the second argument to LocalDateTime.parse(). In the pattern, each letter stands for one field, such as dd for the day, whereas every other character, such as – or /, must appear in the text as written.
LocalDateTime spaced = LocalDateTime.parse("2026-10-04 10:15:30", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
// 2026-10-04T10:15:30
LocalDateTime dayFirst = LocalDateTime.parse("04/10/2026 22:15", DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"));
// 2026-10-04T22:15
LocalDateTime monthFirst = LocalDateTime.parse("10/04/2026 22:15", DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm"));
// 2026-10-04T22:15
LocalDateTime compact = LocalDateTime.parse("20261004101530", DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
// 2026-10-04T10:15:30
LocalDateTime withMillis = LocalDateTime.parse("2026-10-04 10:15:30.123", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
// 2026-10-04T10:15:30.123
A common mistake is to mix HH, the hour on a 24-hour clock, with a, the AM/PM marker. With the pattern yyyy-MM-dd HH:mm:ss a, the text “2019-03-27 10:15:30 AM” parses to 2019-03-27T10:15:30, but “22:15:30 AM” fails because hour 22 cannot be AM. The error is Conflict found: Field AmPmOfDay 1 differs from AmPmOfDay 0 derived from 22:15:30. We use HH for 24-hour text and hh with a for 12-hour text, and never mix the two.
1.3. Common Pattern Letters
Pattern letters are case-sensitive, so MM is the month, but mm is the minute. Most date-time strings need only the letters in the table.
| Letter | Meaning | Example text |
|---|---|---|
| yyyy | Year of era (the year counted within AD or BC) | 2026 |
| uuuu | Year that can be negative. Use it with ResolverStyle.STRICT | 2026 |
| MM / M | Month number, two digits / one or two digits | 10, 4 |
| MMM / MMMM | Short / full month name. Needs a Locale | Oct, October |
| dd / d | Day of month, two digits / one or two digits | 04, 4 |
| EEE | Short day name. Needs a Locale | Sun |
| HH / H | Hour 0 to 23 | 22, 9 |
| hh / h | Hour 1 to 12. Needs a | 10 |
| a | AM/PM marker. Needs a Locale | PM |
| mm | Minute | 15 |
| ss | Second | 30 |
| SSS | Fraction of a second, 3 digits | 123 |
| ‘T’ | Literal text in quotes | T |
| [ ] | Optional part of the text | [:ss] |
A double letter such as dd needs two digits, so “4/10/2026” fails with dd/MM/yyyy at index 0, which means the very first character did not match. Single letters accept one or two digits, so with d/M/yyyy H:mm, both “4/10/2026 9:05” (2026-10-04T09:05) and “14/10/2026 19:05” (2026-10-14T19:05) parse.
2. Locale-specific Patterns
Month names, day names and the AM/PM marker are words, and words depend on the language. A Locale tells Java which language to use, for example Locale.ENGLISH. By default, DateTimeFormatter.ofPattern(pattern) uses the default locale of the JVM, which comes from the settings of the machine. A pattern with MMM, EEE or a works on a developer’s English laptop and fails on a server with a German or French default locale. To avoid the problem, we pass the Locale to ofPattern() or call withLocale().
2.1. 12-Hour Time With AM/PM
The letters hh read the hour from 1 to 12, and a reads the AM or PM marker. Note that 12:30 AM is half past midnight, so the result is 00:30.
DateTimeFormatter f = DateTimeFormatter.ofPattern("dd-MM-yyyy hh:mm a", Locale.ENGLISH);
LocalDateTime evening = LocalDateTime.parse("04-10-2026 10:15 PM", f); // 2026-10-04T22:15
LocalDateTime morning = LocalDateTime.parse("04-10-2026 10:15 AM", f); // 2026-10-04T10:15
LocalDateTime midnight = LocalDateTime.parse("04-10-2026 12:30 AM", f); // 2026-10-04T00:30
LocalDateTime noon = LocalDateTime.parse("04-10-2026 12:30 PM", f); // 2026-10-04T12:30
LocalDateTime lowercase = LocalDateTime.parse("04-10-2026 10:15 pm", f); // DateTimeParseException at index 17
Text fields such as the AM/PM marker are case-sensitive by default, so the lowercase “pm” fails. If we want to accept both cases, we build the formatter with DateTimeFormatterBuilder and call parseCaseInsensitive().
DateTimeFormatter f = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.appendPattern("dd-MM-yyyy hh:mm a")
.toFormatter(Locale.ENGLISH);
LocalDateTime evening = LocalDateTime.parse("04-10-2026 10:15 pm", f); // 2026-10-04T22:15
To go the other way, from LocalDateTime to text such as “10:15 PM”, we format the time in a 12-hour pattern with the same letters.
2.2. Month and Day Names
MMM reads a short month name such as Oct, and MMMM reads a full name such as October. The name must be in the language of the formatter, so with Locale.GERMAN, the English “Oct” fails at index 0.
DateTimeFormatter en = DateTimeFormatter.ofPattern("MMM d, yyyy h:mm a", Locale.ENGLISH);
LocalDateTime shortName = LocalDateTime.parse("Oct 4, 2026 10:15 AM", en); // 2026-10-04T10:15
LocalDateTime fullName = LocalDateTime.parse("October 4, 2026 10:15 AM",
DateTimeFormatter.ofPattern("MMMM d, yyyy h:mm a", Locale.ENGLISH));
// 2026-10-04T10:15
LocalDateTime withDayName = LocalDateTime.parse("Sun, Oct 4 2026 10:15",
DateTimeFormatter.ofPattern("EEE, MMM d yyyy HH:mm", Locale.ENGLISH));
// 2026-10-04T10:15
LocalDateTime german = LocalDateTime.parse("Oct 4, 2026 10:15 AM",
DateTimeFormatter.ofPattern("MMM d, yyyy h:mm a", Locale.GERMAN));
// DateTimeParseException at index 0
Even two English locales can differ, because since Java 9, month names come from the CLDR (Common Locale Data Repository, a public collection of names and formats for each language). In Java 21 and 25, Locale.UK writes September as “Sept”, so “Sep 4, 2026 10:15” parses with Locale.ENGLISH but fails with Locale.UK, whereas “Sept 4, 2026 10:15” parses with Locale.UK. For machine-written text in English, Locale.ENGLISH or Locale.US is the safe choice.
2.3. Non-English Month Names
Sometimes the dates are in another language. For example, a travel app that imports bookings from a French partner gets 29-mai-2019 instead of 29-May-2019. To parse French dates, we give the formatter the language with either DateTimeFormatter.withLocale() or the two-argument ofPattern().
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MMMM-dd HH:mm:ss a")
.withLocale(Locale.FRENCH);
LocalDateTime mai = LocalDateTime.parse("2019-mai-29 10:15:30 AM", formatter); // 2019-05-29T10:15:30
LocalDateTime octobre = LocalDateTime.parse("4 octobre 2026 10:15",
DateTimeFormatter.ofPattern("d MMMM yyyy HH:mm", Locale.FRENCH)); // 2026-10-04T10:15
LocalDateTime oct = LocalDateTime.parse("4 oct. 2026 10:15",
DateTimeFormatter.ofPattern("d MMM yyyy HH:mm", Locale.FRENCH)); // 2026-10-04T10:15
Some French short month names include a dot, such as “oct.”, so the text must contain the dot too. We create a Locale for any other language in the same way.
3. Parsing a String With a Time Zone or Offset
A LocalDateTime has no field for a time zone, so LocalDateTime.parse(“2026-10-04T10:15:30Z”) fails with “unparsed text found at index 19”. The parser reads the date and the time, then finds the Z (which means UTC) and has nowhere to store it. Two other classes can hold that part. OffsetDateTime keeps an offset such as +05:30, and ZonedDateTime keeps a zone name such as Asia/Kolkata. We parse a string with an offset or zone into OffsetDateTime or ZonedDateTime first and call toLocalDateTime().
LocalDateTime fromZ = OffsetDateTime.parse("2026-10-04T10:15:30Z").toLocalDateTime(); // 2026-10-04T10:15:30
LocalDateTime fromOffset = OffsetDateTime.parse("2026-10-04T10:15:30+05:30").toLocalDateTime(); // 2026-10-04T10:15:30
LocalDateTime fromZone = ZonedDateTime.parse("2026-10-04T10:15:30+05:30[Asia/Kolkata]")
.toLocalDateTime(); // 2026-10-04T10:15:30
LocalDateTime fromPattern = OffsetDateTime.parse("2026-10-04 10:15:30 +05:30",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss XXX"))
.toLocalDateTime(); // 2026-10-04T10:15:30
The method toLocalDateTime() keeps the clock time printed in the string and throws the offset away. We get the same result when we pass an offset-aware formatter, such as ISO_DATE_TIME or a pattern with XXX, to LocalDateTime.parse().
When we must compare two strings with different offsets, or show the time in UTC, we convert the instant (the real moment in time) before we drop the zone. For that, we parse the string to a UTC date-time, or we convert the string to ZonedDateTime when it carries a zone name.
A +05:30 string and a Z string with the same clock time give the same LocalDateTime, even though the two moments are 5 hours 30 minutes apart in real time.
4. Parsing a Date-only String to LocalDateTime
A string such as “2026-10-04” has no time, but LocalDateTime.parse() needs one. The ISO version fails at index 10, where the T should start, and a pattern without time letters fails with Unable to obtain LocalDateTime from TemporalAccessor: {},ISO resolved to 2026-10-04. We parse the text as a LocalDate and add the time.
LocalDateTime startOfDay = LocalDate.parse("2026-10-04").atStartOfDay(); // 2026-10-04T00:00
LocalDateTime fromPattern = LocalDate.parse("04-10-2026",
DateTimeFormatter.ofPattern("dd-MM-yyyy")).atStartOfDay(); // 2026-10-04T00:00
LocalDateTime morning = LocalDate.parse("2026-10-04").atTime(9, 30); // 2026-10-04T09:30
LocalDateTime endOfDay = LocalDate.parse("2026-10-04").atTime(LocalTime.MAX); // 2026-10-04T23:59:59.999999999
When the code must call LocalDateTime.parse(), for example inside one shared parsing method, parseDefaulting() fills in the missing fields with fixed values. In the snippet, the hour and the minute default to 0.
DateTimeFormatter f = new DateTimeFormatterBuilder()
.appendPattern("dd-MM-yyyy")
.parseDefaulting(ChronoField.HOUR_OF_DAY, 0)
.parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)
.toFormatter();
LocalDateTime date = LocalDateTime.parse("04-10-2026", f); // 2026-10-04T00:00
The calls atStartOfDay() and atTime(LocalTime.MAX) give the start and end of a day, which we need for a query such as “all orders placed on October 4”.
5. Strict Parsing With ResolverStyle.STRICT
After the formatter reads the fields, it checks them and turns them into a date and time, a step Java calls resolving, and the ResolverStyle decides how strict the check is. By default, ofPattern() uses ResolverStyle.SMART, which corrects some invalid values, so February 30 becomes February 28. The ISO formatter behind LocalDateTime.parse(text) uses ResolverStyle.STRICT, so the two methods disagree on the same date.
DateTimeFormatter smart = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
LocalDateTime feb30 = LocalDateTime.parse("30-02-2026 10:15", smart); // 2026-02-28T10:15 (moved to last day)
LocalDateTime apr31 = LocalDateTime.parse("31-04-2026 10:15", smart); // 2026-04-30T10:15
LocalDateTime hour24 = LocalDateTime.parse("04-10-2026 24:00", smart); // 2026-10-05T00:00 (next day)
LocalDateTime day32 = LocalDateTime.parse("32-01-2026 10:15", smart); // DateTimeParseException: Invalid value for DayOfMonth (valid values 1 - 28/31): 32
LocalDateTime iso = LocalDateTime.parse("2026-02-30T10:15"); // DateTimeParseException: Invalid date 'FEBRUARY 30'
For input from users or files, 30-02-2026 should be an error, not February 28, so we call withResolverStyle(ResolverStyle.STRICT) to turn the correction off. With STRICT, the year must be uuuu, not yyyy. The reason is that yyyy means the year of era (AD or BC), so a strict resolver also wants the era, and because the pattern has none, even a valid date fails.
DateTimeFormatter wrong = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm")
.withResolverStyle(ResolverStyle.STRICT);
LocalDateTime fails = LocalDateTime.parse("04-10-2026 10:15", wrong);
// DateTimeParseException: Unable to obtain LocalDateTime from TemporalAccessor:
// {DayOfMonth=4, MonthOfYear=10, YearOfEra=2026},ISO resolved to 10:15
DateTimeFormatter strict = DateTimeFormatter.ofPattern("dd-MM-uuuu HH:mm")
.withResolverStyle(ResolverStyle.STRICT);
LocalDateTime valid = LocalDateTime.parse("04-10-2026 10:15", strict); // 2026-10-04T10:15
LocalDateTime feb30 = LocalDateTime.parse("30-02-2026 10:15", strict); // DateTimeParseException: Invalid date 'FEBRUARY 30'
LocalDateTime hour24 = LocalDateTime.parse("04-10-2026 24:00", strict); // DateTimeParseException: Invalid value for HourOfDay (valid values 0 - 23): 24
The third style, ResolverStyle.LENIENT, rolls the extra days over into the next month, so 30-02-2026 becomes 2026-03-02T10:15. Each resolver style handles invalid values in its own way, and STRICT is the one we use for date validation of user input. With STRICT, bad input throws DateTimeParseException, so we catch it, as section 6 shows.
6. DateTimeParseException Messages and Fixes
DateTimeParseException is an unchecked exception, so the compiler does not force us to catch it. Besides the message, it has two useful methods. The method getErrorIndex() returns the position where parsing stopped, and getParsedString() returns the input text.
try {
LocalDateTime parsed = LocalDateTime.parse("2026-10-04 10:15:30");
} catch (DateTimeParseException e) {
String message = e.getMessage(); // Text '2026-10-04 10:15:30' could not be parsed at index 10
int index = e.getErrorIndex(); // 10
String input = e.getParsedString(); // 2026-10-04 10:15:30
}
The index points at the first character that did not match, which shows where the problem is. The messages in the table are the same in Java 21 and Java 25, and “could not be parsed” is short for the full “Text ‘…’ could not be parsed” prefix.
| Code | Message | Fix |
|---|---|---|
| parse(“2026-10-04 10:15:30”) | could not be parsed at index 10 | Use a T, or the pattern yyyy-MM-dd HH:mm:ss |
| parse(“2026-10-04T9:15:30”) | could not be parsed at index 11 | ISO needs two-digit hours. Use the pattern letter H |
| parse(“2026-10-04T10:15:30Z”) | unparsed text found at index 19 | Parse as OffsetDateTime (section 3) |
| parse(“2026-10-04”) | could not be parsed at index 10 | LocalDate.parse(s).atStartOfDay() |
| “04/10/2026 10:15” with dd-MM-yyyy HH:mm | could not be parsed at index 2 | The separators must match the pattern |
| “04-10-2026 10:15:30” with dd-MM-yyyy HH:mm | unparsed text found at index 16 | Add :ss to the pattern |
| “04-13-2026 10:15” with dd-MM-yyyy HH:mm | Invalid value for MonthOfYear (valid values 1 – 12): 13 | Check the order of day and month |
| dd-mm-yyyy HH:mm | could not be parsed at index 14 | mm is minutes. Months are MM |
| dd-MM-YYYY HH:mm | Unable to obtain LocalDateTime from TemporalAccessor: {WeekBasedYear[…]=2026, …} | YYYY is the week-based year. Use yyyy |
| DD-MM-yyyy HH:mm | Conflict found: Field MonthOfYear 1 differs from MonthOfYear 10 derived from 2026-01-04 | DD is the day of the year. Use dd |
| dd-MM-yyyy hh:mm (no a) | Unable to obtain LocalDateTime from TemporalAccessor: {HourOfAmPm=10, MinuteOfHour=15}… | Use HH, or add a |
| dd-MM-yyyy HH:mm with STRICT | Unable to obtain LocalDateTime … {…, YearOfEra=2026} | Use uuuu (section 5) |
The order of the fields inside {…} can differ between Java versions, and the WeekFields part of the YYYY message depends on the default locale, so we never compare these messages in code.
7. Format LocalDateTime Back to String
The method toString() prints the ISO format. The output of toString() leaves out the seconds when seconds and nanoseconds are zero, so a parsed 10:15:00 prints as 10:15. To print any other layout, we call format() with a formatter.
LocalDateTime dateTime = LocalDateTime.parse("04-10-2026 22:15",
DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm"));
String text = dateTime.toString(); // 2026-10-04T22:15
String iso = dateTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME); // 2026-10-04T22:15:00
String spaced = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); // 2026-10-04 22:15:00
String amPm = dateTime.format(DateTimeFormatter.ofPattern("dd MMM yyyy, hh:mm a", Locale.ENGLISH));
// 04 Oct 2026, 10:15 PM
String dayName = dateTime.format(DateTimeFormatter.ofPattern("EEEE, MMMM d", Locale.ENGLISH));
// Sunday, October 4
The same formatter can both parse and format, so a value written with one pattern reads back to an equal LocalDateTime. The pattern letters from section 1.3 also work when we format a LocalDateTime to a String.
8. LocalDateTime Parsing FAQs
Developers working with LocalDateTime.parse() often ask about mixed input formats, fractions of a second, thread safety and time zones.
8.1. How Do I Parse a String That Comes in More Than One Format?
We mark the parts that vary as optional with square brackets, which handles small differences between strings. For example, yyyy-MM-dd[‘T’][ ]HH:mm[:ss] accepts either a T or a space, with or without seconds.
DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd['T'][ ]HH:mm[:ss]");
LocalDateTime withT = LocalDateTime.parse("2026-10-04T10:15:30", f); // 2026-10-04T10:15:30
LocalDateTime withSpace = LocalDateTime.parse("2026-10-04 10:15", f); // 2026-10-04T10:15
When layouts differ more, such as dd/MM/yyyy and yyyy-MM-dd, we keep a list of formatters, try them in order, and return the first result that does not throw an exception.
8.2. How Do I Parse Milliseconds or Microseconds?
With the ISO format, we need no pattern, because it reads 1 to 9 fraction digits. In a custom pattern, the number of S letters must equal the number of digits, so we use SSS for milliseconds and SSSSSS for microseconds.
LocalDateTime millis = LocalDateTime.parse("2026-10-04 10:15:30.123",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); // 2026-10-04T10:15:30.123
LocalDateTime micros = LocalDateTime.parse("2026-10-04 10:15:30.123456",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS")); // 2026-10-04T10:15:30.123456
LocalDateTime tooFew = LocalDateTime.parse("2026-10-04 10:15:30.123456",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")); // DateTimeParseException: unparsed text found at index 23
8.3. Is DateTimeFormatter Thread-safe?
Yes. A DateTimeFormatter is immutable, so many threads can share one formatter. We create one formatter per pattern and keep it in a static final field instead of calling ofPattern() again for every string. The old SimpleDateFormat, on the other hand, is not thread-safe, which matters when we format dates in Java from several threads.
8.4. How Do I Convert the Parsed LocalDateTime to ZonedDateTime?
We call atZone(ZoneId), which attaches a time zone and keeps the clock time the same. For example, dateTime.atZone(ZoneId.of(“Europe/Paris”)) returns 2026-10-04T22:15+02:00[Europe/Paris]. The call toLocalDateTime() drops the zone again, so we can convert between LocalDateTime and ZonedDateTime in both directions.
9. Conclusion
LocalDateTime.parse(text) reads ISO strings, which need a T and two-digit hours and minutes, whereas seconds and fractions are optional. For every other layout, we pass a DateTimeFormatter, using HH for 24-hour text and hh with a for 12-hour text, and a Locale whenever the text contains month names, day names or AM/PM.
Strings with an offset go through OffsetDateTime or ZonedDateTime, date-only strings go through LocalDate, and user input goes through a STRICT formatter with uuuu. When parsing fails, the error index of DateTimeParseException points at the first character that did not match.
10. References
- LocalDateTime JavaDoc (Java 25)
- DateTimeFormatter JavaDoc (Java 25)
- DateTimeFormatterBuilder JavaDoc (Java 25)
- ResolverStyle JavaDoc (Java 25)
- LocalDate JavaDoc (Java 25)
Happy Learning !!