Here you can find the source of getCurrentDateStr()
public static String getCurrentDateStr()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String ONLY_DATE_FORMAT = "yyyy??MM??dd??"; public static String getCurrentDateStr() { SimpleDateFormat dateFormat = new SimpleDateFormat(ONLY_DATE_FORMAT); Date d = new Date(System.currentTimeMillis()); return dateFormat.format(d); }/*from w w w. ja v a 2 s . co m*/ }