Latest Questions tagged Localdatetime

Browse all latest questions tagged Localdatetime

91
Votes
Published 08 Sep, 2022
Java - Java LocalDateTime Text could not be parsed at index 0 exception

Trying to convert a date which is in String format to Java LocalDateTime. private DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"); private String caseStartDate = dateF...

66
Votes
Published 03 Sep, 2022
Java - How to parse an ISO date with LocalDateTime.parse(...)

I want to parse a date string like 2011-11-30 like this: LocalDateTime.parse("2011-11-30", DateTimeFormatter.ISO_LOCAL_DATE) But I get the following exception: java.time.format.DateTimeParseExcept...

83
Votes
Published 27 Aug, 2022
Java - LocalDateTime format with time zone and milliseconds

I'm trying to write a DateTimeFormatter to parse the following format: 2020-05-29T07:51:33.106-07:00 I have looked at ISO_OFFSET_DATE_TIME, but the problem is it does not contain milliseconds. So I...