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