Here you can find the source of getCurrentDate()
@SuppressLint("SimpleDateFormat") public static String getCurrentDate()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; public class Main { @SuppressLint("SimpleDateFormat") public static String getCurrentDate() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // sdf.setTimeZone(TimeZone.getTimeZone("UTC")); String text = sdf.format(date); return text; }/*from ww w . j a v a 2 s . c om*/ }