Here you can find the source of getCurrentLocalDate()
public static LocalDate getCurrentLocalDate()
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Calendar; import java.util.Locale; public class Main { private static final DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy"); private static final DateTimeFormatter germanFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM) .withLocale(Locale.GERMAN); /**// w w w .j a v a 2 s. com * get the current date and time in LocalDate format * * @return current LocalDate */ public static LocalDate getCurrentLocalDate() { Calendar currentDateTime = Calendar.getInstance(); LocalDate currentDate = LocalDate.parse(dateFormat.format(currentDateTime.getTime()).toString(), germanFormatter); return currentDate; } }