Android examples for java.util:Date Format
get Current Day in yyyy-MM-dd format
import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ @SuppressLint("SimpleDateFormat") public static String getCurDay() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); final String path = dateFormat.format(date); return path; }/*from ww w . j a v a 2s.c o m*/ }