Java Calendar Millisecond toCalendar(long millis)

Here you can find the source of toCalendar(long millis)

Description

to Calendar

License

Apache License

Declaration

public static Calendar toCalendar(long millis) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static Calendar toCalendar(Date date) {
        Calendar c = new GregorianCalendar();
        c.setTime(date);/*  w w  w  . j av  a2  s.co m*/
        return c;
    }

    public static Calendar toCalendar(long millis) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(new Date(millis));
        return cal;
    }
}

Related

  1. setCalendar(Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing)
  2. setCalendar(Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing, boolean roundSeconds)
  3. setCalendarTime(Calendar inCalendar, int hr, int min, int sec, int milliSec)
  4. setTimeInMillis(Calendar _calendar, long _timemillis)
  5. toCalendar(final long millis)
  6. toStringDateTimeMillisecond(Calendar calendar)
  7. translateToMilliseconds(Calendar calendar)