Here you can find the source of getTodayYmd()
public static String getTodayYmd()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final String YYYYMMDD_FORMAT = "yyyy-MM-dd"; public static String getTodayYmd() { Calendar c = Calendar.getInstance(); return new SimpleDateFormat(YYYYMMDD_FORMAT).format(c.getTime()); }//from w ww.j ava2s. c o m }