Here you can find the source of getFormatCurrentTime(String format)
public static String getFormatCurrentTime(String format)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getFormatCurrentTime(String format) { return getFormatDateTime(new Date(), format); }/*from ww w .ja v a2 s . c o m*/ public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }