get Current Date in yyyyMMdd format - Android java.util

Android examples for java.util:Date Compare

Description

get Current Date in yyyyMMdd format

Demo Code

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

}

Related Tutorials