Here you can find the source of getCurrentString(String pattern)
public static String getCurrentString(String pattern)
//package com.java2s; import java.text.*; import java.util.Calendar; import java.util.TimeZone; public class Main { public final static String DEFAULT_SIMPLEDATE_FORMAT = "yyyy-MM-dd HH:mm:ss SSS"; public static String getCurrentString() { return getCurrentString(DEFAULT_SIMPLEDATE_FORMAT); }/*w ww . j ava2 s. c o m*/ public static String getCurrentString(String pattern) { SimpleDateFormat f = new SimpleDateFormat(pattern); return f.format(Calendar.getInstance(TimeZone.getDefault()).getTime()); } }