Create the formatter using a pattern
import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class Main { public static void main(String[] args) { LocalDate ld = LocalDate.of(2018, 12, 25); String pattern = "'Christmas in' yyyy 'is on' EEEE"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); String str = ld.format(formatter); System.out.println(str);/*from w ww. j a v a 2 s . c o m*/ } }