Here you can find the source of currentDate()
public static String currentDate()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String currentDate() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return dateFormat.format(new Date()); }//from w w w. j a v a 2 s . co m }