Java Calendar UTC getUTCCalendarInstance()

Here you can find the source of getUTCCalendarInstance()

Description

Get an instance of a Calendar object with a UTC time zone.

License

Open Source License

Return

A object with the time zone set to UTC.

Declaration

@Deprecated
public static Calendar getUTCCalendarInstance() 

Method Source Code

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

import java.util.Calendar;

import java.util.Locale;
import java.util.SimpleTimeZone;

public class Main {
    /**//from   w  ww. j  ava 2  s  . c om
     * Get an instance of a {@link Calendar} object with a UTC time zone.
     * The calendar object will be set to the current time, and can have its
     * value updated as required.
     *
     * @return A {@link Calendar} object with the time zone set to UTC.
     * @see Calendar#getInstance(TimeZone, Locale)
     */
    @Deprecated
    public static Calendar getUTCCalendarInstance() {
        return Calendar.getInstance(new SimpleTimeZone(0, "UTC"), Locale.ENGLISH);
    }
}

Related

  1. getUtcCalendar()
  2. getUTCCalendar()
  3. getUTCCalendar()
  4. getUTCCalendar(Date date)
  5. getUTCCalendarFromLocalDate(Date date)
  6. getUtcMillisFromEpoch(Calendar calendar)
  7. subtractFromUTCMilliSeconds(int calendarTime, int actualValue)