Android Time Get getUTCTime()

Here you can find the source of getUTCTime()

Description

get UTC Time

Declaration

public static long getUTCTime() 

Method Source Code

//package com.java2s;

import java.util.Calendar;

import java.util.Locale;

public class Main {
    public static long getUTCTime() {
        Calendar cal = Calendar.getInstance(Locale.CHINA);
        int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET);
        int dstOffset = cal.get(java.util.Calendar.DST_OFFSET);
        cal.add(java.util.Calendar.MILLISECOND, -(zoneOffset + dstOffset));
        return cal.getTimeInMillis();
    }/*from w  ww  . j av  a2 s  .  co  m*/
}

Related

  1. getRequestTime()
  2. getSystemTime()
  3. getTime1()
  4. getTimeInMillis()
  5. getTimestamp()
  6. getUnixTime()
  7. getUnixTime()