Convert long To Calendar - Android java.util

Android examples for java.util:Calendar

Description

Convert long To Calendar

Demo Code

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

public class Main{

    public static Calendar longToCalendar(Long time) {
        Calendar c = null;/* w ww  .j  a v a 2 s  .c  om*/
        if (time != null) {
            c = Calendar.getInstance();
            c.setTimeInMillis(time);
        }
        return c;
    }

}

Related Tutorials