Here you can find the source of getCurrentStringDateYMD()
public static final String getCurrentStringDateYMD()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final String PATTERN_YYYYMMDD = "yyyy-MM-dd"; public static final String getCurrentStringDateYMD() { return getCurrentStringDate(PATTERN_YYYYMMDD); }//from ww w .j a v a 2 s . c om public static final String getCurrentStringDate(String pattern) { Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat(pattern); return formatter.format(currentTime); } }