Convert Date to Calendar - Android java.util

Android examples for java.util:Calendar

Description

Convert Date to Calendar

Demo Code

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Pattern;

public class Main{


    public static Calendar toCalendar(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/* w  w w  . j  av a2 s .c o  m*/
        return calendar;
    }

}

Related Tutorials