Here you can find the source of setDateFormat(String pattern)
public static void setDateFormat(String pattern)
//package com.java2s; /*/*w w w . j ava2 s. c o m*/ * License GNU LGPL * Copyright (C) 2012 Amrullah <amrullah@panemu.com>. */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; public class Main { private static DateTimeFormatter dateTimeFormatter; private static DateFormat dateFormat; public static void setDateFormat(String pattern) { dateTimeFormatter = DateTimeFormatter.ofPattern(pattern); dateFormat = new SimpleDateFormat(pattern); } }