Answers for "java parse date string to localdatetime"

6

convert string to localdatetime

//convert String to LocalDateTime
String str = "2016-03-04 11:30";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(str, formatter);
Posted by: Guest on May-12-2020
0

how to parse a specific datetime to localdatetime

LocalDateTime date = LocalDateTime.parse("1995-07-25T15:03:45");
Posted by: Guest on August-07-2020
0

how to turna date into a LocalDateTime java

public LocalDateTime convertToLocalDateTimeViaMilisecond(Date dateToConvert) {
    return Instant.ofEpochMilli(dateToConvert.getTime())
      .atZone(ZoneId.systemDefault())
      .toLocalDateTime();
}
Posted by: Guest on February-10-2021

Code answers related to "java parse date string to localdatetime"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language