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()); }/*w w w . j a v a 2 s . c om*/ }