Java tutorial
import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { public static void main(String[] args) { DateFormat df = DateFormat.getDateInstance(); if (df instanceof SimpleDateFormat) { SimpleDateFormat sdf = (SimpleDateFormat) df; System.out.println(sdf.toPattern()); } else { System.out.println("sorry"); } } }