Here you can find the source of getNowDateStr(String formatStr)
public static String getNowDateStr(String formatStr)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getNowDateStr(String formatStr) { SimpleDateFormat format = new SimpleDateFormat(formatStr); return format.format(getNowDate()); }/*from www . j a va2 s. c o m*/ public static Date getNowDate() { Calendar c = Calendar.getInstance(); return c.getTime(); } }