get Day value from date value - Android java.util

Android examples for java.util:Day

Description

get Day value from date value

Demo Code

import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class Main{

    public static int getDay(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*from   w w w .  ja va2 s.  co m*/
        return c.get(Calendar.DATE);

    }

}

Related Tutorials