Here you can find the source of getNow(String format)
public static String getNow(String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNow(String format) { return dateToString(new Date(), format); }//from www .j a v a2 s. c o m public static String dateToString(Date date, String pattern) { if (date == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat(pattern); String returnValue = ""; returnValue = sdf.format(date); return returnValue; } }