Here you can find the source of getCurrentDateString(String dateFormat)
public static String getCurrentDateString(String dateFormat)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { public static String getCurrentDateString(String dateFormat) { Calendar cal = Calendar.getInstance(TimeZone.getDefault()); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(cal.getTime()); }//from ww w .j a v a2 s . com }