Android examples for java.util:Date Compare
get Current Date in yyyyMMdd format
import android.content.Context; import android.telephony.TelephonyManager; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String getCurrentlyDate() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); return dateFormat.format(new Date()); }//from ww w. java2 s . c o m }