Java Calendar UTC getCalendarUTC(long timeMS)

Here you can find the source of getCalendarUTC(long timeMS)

Description

Get a new UTC calendar set to the given time.

License

Open Source License

Parameter

Parameter Description
timeMS a parameter

Declaration

public static Calendar getCalendarUTC(long timeMS) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

import java.util.Date;
import java.util.TimeZone;

public class Main {
    /**//from   w w  w  . j a v  a2 s .  c  o  m
     * Get a new UTC calendar set to the given time.
     * @param timeMS
     * @return
     */
    public static Calendar getCalendarUTC(long timeMS) {
        Calendar cal = getClaendarUTC();
        cal.setTime(new Date(timeMS));
        return cal;
    }

    /**
     * Get a new Calendar Set to UTC time zone.
     * @return
     */
    public static Calendar getClaendarUTC() {
        return Calendar.getInstance(TimeZone.getTimeZone("GMT+0:00"));
    }
}

Related

  1. getCalendarUTC()
  2. getCalendarUTC()
  3. getLocalCalendarFromUTC(Calendar utc)
  4. getUTCCalendar()
  5. getUtcCalendar()
  6. getUTCCalendar()