Here you can find the source of getDateFormatForLocalDate()
public static DateTimeFormatter getDateFormatForLocalDate()
//package com.java2s; /*// w w w . ja v a 2 s . co m * License GNU LGPL * Copyright (C) 2012 Amrullah <amrullah@panemu.com>. */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; import java.util.Locale; public class Main { private static Locale loc = new Locale("es", "PY"); private static DateTimeFormatter dateTimeFormatter; public static DateTimeFormatter getDateFormatForLocalDate() { if (dateTimeFormatter == null) { dateTimeFormatter = DateTimeFormatter .ofPattern(getLocaleDatePattern()); } return dateTimeFormatter; } private static String getLocaleDatePattern() { DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.SHORT, loc); SimpleDateFormat simpleFormat = (SimpleDateFormat) dateFormat; String pattern = simpleFormat.toPattern(); return pattern; } }