Java Calendar UTC getCalendarUTC()

Here you can find the source of getCalendarUTC()

Description

Get a UTC calendar with Locale US.

License

Open Source License

Declaration

private static Calendar getCalendarUTC() 

Method Source Code

//package com.java2s;

import java.util.Calendar;

import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;

public class Main {
    /**/*from  w  ww  . ja v  a2 s . c  om*/
     * The UTC time zone.
     */
    private static final ThreadLocal<TimeZone> UTC_TZ = new ThreadLocal<TimeZone>() {
        @Override
        protected TimeZone initialValue() {
            return TimeZone.getTimeZone("UTC");
        }
    };

    /**
     * Get a UTC calendar with Locale US.
     */
    private static Calendar getCalendarUTC() {
        return new GregorianCalendar(UTC_TZ.get(), Locale.US);
    }
}

Related

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