Here you can find the source of nowDate()
public static String nowDate()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String DEFAULT_YMD_FORMAT = "yyyy-MM-dd"; public static String nowDate() { SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_YMD_FORMAT); return sdf.format(new Date()); }/*from ww w. j a v a2 s . c o m*/ }