Here you can find the source of stringToLocalDate(String birthDate)
static LocalDate stringToLocalDate(String birthDate)
//package com.java2s; //License from project: LGPL import java.time.LocalDate; public class Main { static LocalDate stringToLocalDate(String birthDate) { if (birthDate.length() != 8) { throw new IllegalArgumentException("Birth date must be of form yyyyMMdd, i.e. eight characters long."); }// w w w . j a va2 s . c o m return LocalDate.of(Integer.parseInt(birthDate.substring(0, 4)), Integer.parseInt(birthDate.substring(4, 6)), Integer.parseInt(birthDate.substring(6, 8))); } }