String date = "2016-08-16";
//default, ISO_LOCAL_DATE
LocalDate localDate = LocalDate.parse(date);
// not default case
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/MM/yyyy");
String date = "16/08/2016";
LocalDate localDate = LocalDate.parse(date, formatter);
// standard format
LocalDateTime dateTime = LocalDateTime.parse("2018-08-09T13:00:00");
Last active
August 9, 2018 12:25
-
-
Save rkcb/1a4a4c5b0d034af15b6d7a2c7aa700fc to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment