Here you can find the source of parseToLocalDate(String format, String date)
public static LocalDate parseToLocalDate(String format, String date)
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { public static LocalDate parseToLocalDate(String format, String date) { return parseToLocalDate(DateTimeFormatter.ofPattern(format), date); }//from ww w . j ava2 s . c o m public static LocalDate parseToLocalDate(DateTimeFormatter formatter, String date) { return LocalDate.from(formatter.parse(date)); } public static LocalDateTime parse(String format, String datetime) { return parse(DateTimeFormatter.ofPattern(format), datetime); } public static LocalDateTime parse(DateTimeFormatter formatter, String timestamp) { return LocalDateTime.from(formatter.parse(timestamp)); } }