Create calendar From Date - Android java.util

Android examples for java.util:Calendar

Description

Create calendar From Date

Demo Code

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main{

    public static Calendar calendarFromDate(Date d) {
        Calendar c = Calendar.getInstance();
        c.setTime(d);/*from ww w  .  j  a va  2 s. c  om*/
        return c;
    }

}

Related Tutorials