Java UTC TimeZone getUTCTimeZone()

Here you can find the source of getUTCTimeZone()

Description

Retrieves a TimeZone object that represents the UTC (universal coordinated time) time zone.

License

Open Source License

Return

A TimeZone object that represents the UTC time zone.

Declaration

public static TimeZone getUTCTimeZone() 

Method Source Code

//package com.java2s;
/*/*from w  w  w.  j a v a 2  s.  co m*/
 * Copyright (C) 2008-2018 Ping Identity Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (GPLv2 only)
 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses>.
 */

import java.util.TimeZone;

public class Main {
    /**
     * The {@code TimeZone} object that represents the UTC (universal coordinated
     * time) time zone.
     */
    private static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone("UTC");

    /**
     * Retrieves a {@code TimeZone} object that represents the UTC (universal
     * coordinated time) time zone.
     *
     * @return  A {@code TimeZone} object that represents the UTC time zone.
     */
    public static TimeZone getUTCTimeZone() {
        return UTC_TIME_ZONE;
    }
}

Related

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