Check out example codes for "convert string to localdatetime". It will help you in understanding the concepts better.

Code Example 1

//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);

Learn ReactJs, React Native from akashmittal.com