Java UTC TimeZone UTCTimeZone()

Here you can find the source of UTCTimeZone()

Description

Returns the UTC time zone.

License

Apache License

Return

The UTC time zone. Defaults to the closely-related GMT time zone, if for some reason the UTC time zone identifier cannot be understood.

Declaration

public static TimeZone UTCTimeZone() 

Method Source Code

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

import java.util.TimeZone;

public class Main {
    public final static String UTC_TIMEZONE_IDENTIFIER = "UTC";

    /**//ww w . j  ava2 s.  c  o m
     * Returns the UTC time zone.
     *
     * @return The UTC time zone.  Defaults to the closely-related GMT time zone,
     *         if for some reason the UTC time zone identifier cannot be understood.
     */
    public static TimeZone UTCTimeZone() {
        return TimeZone.getTimeZone(UTC_TIMEZONE_IDENTIFIER);
    }
}

Related

  1. formatTimezoneOffsetFromUTC(TimeZone tz)
  2. getUTCTimeZone()
  3. getUTCTimeZone()
  4. localToUTC(long local)
  5. utc()