Java Calendar Calculate getCalendar(long millis)

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

Description

get Calendar

License

Apache License

Declaration

public static Calendar getCalendar(long millis) 

Method Source Code

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

import java.util.*;

public class Main {
    /**//from w  ww  . j a  v a2 s . com
     * @since 2008-01-02
     */
    public static Calendar getCalendar(long millis) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(millis);
        return c;
    }

    /**
     * @since 2008-01-02
     */
    public static Calendar getCalendar(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c;
    }
}

Related

  1. copyCalendar(final Calendar calendar, final boolean stripTime)
  2. decode(String timestamp, Calendar calendar)
  3. encode(Calendar calendar, boolean encodeTzOffset, StringBuilder buf)
  4. equals(Calendar calendar1, Calendar calendar2)
  5. FormatTime(Calendar p_time, boolean p_showMilliseconds)
  6. getGregorianCalendar(String yyyymmdd)
  7. getLongTime(Calendar cal)
  8. getTimeStr3(Calendar timeInstance)
  9. getTimeString(Calendar cal)