Here you can find the source of localDateToString(LocalDate date)
static public String localDateToString(LocalDate date)
//package com.java2s; //License from project: Open Source License import java.time.*; public class Main { /**// ww w. ja v a 2 s . c o m * localDateToString, This returns the supplied date in the ISO-8601 format (uuuu-MM-dd). For * any CE years that are between 0 and 9999 inclusive, the output will have a fixed length of 10 * characters. Years before or after that range will output longer strings. If the date is null, * this will return an empty string (""). */ static public String localDateToString(LocalDate date) { return localDateToString(date, ""); } /** * localDateToString, This returns the supplied date in the ISO-8601 format (uuuu-MM-dd). For * any CE years that are between 0 and 9999 inclusive, the output will have a fixed length of 10 * characters. Years before or after that range will output longer strings. If the date is null, * this will return the value of emptyDateString. */ static public String localDateToString(LocalDate date, String emptyDateString) { return (date == null) ? emptyDateString : date.toString(); } }