Here you can find the source of now(String dateFormat)
public static String now(String dateFormat)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String now(String dateFormat) { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); }//from ww w . ja va2 s . c o m }