Android examples for java.util:Date Format
get Current Date in yyyy-MM-dd format using SimpleDateFormat
import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy-MM-dd"); public static String getCurrentDate() { Date d = new Date(System.currentTimeMillis()); return yearFormat.format(d); }/* www.jav a 2s . c om*/ }