Here you can find the source of date(LocalDate date)
public static String date(LocalDate date)
//package com.java2s; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Main { private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; private static final DateTimeFormatter timestampFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; private static final DateTimeFormatter zonelessTimestampFormatter = DateTimeFormatter .ofPattern("yyyy-MM-dd HH:mm:ss"); public static String date(LocalDate date) { return dateFormatter.format(date); }//from www.j a v a2 s .c o m public static String date(ZonedDateTime date) { return timestampFormatter.format(date); } public static String date(LocalDateTime date) { return zonelessTimestampFormatter.format(date); } }