Android Milliseconds Calculate getTimeZoneOffsetInMillis()

Here you can find the source of getTimeZoneOffsetInMillis()

Description

get Time Zone Offset In Millis

Return

the timezone offset of the current device relative to UTC

Declaration

static long getTimeZoneOffsetInMillis() 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    /**/*w  ww . j  a  v  a2s  . c  om*/
     * @return the timezone offset of the current device relative to UTC
     */
    static long getTimeZoneOffsetInMillis() {
        Calendar cal = Calendar.getInstance();
        return cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
    }
}

Related

  1. millisecondsAfterNearestFifteenMinutes( String date, String time, int milliseconds)
  2. millisecondsAfter(String date, String time, int milliseconds)
  3. formatDuration(final Resources res, final long millis)
  4. getMillisPerUnit(int unit)
  5. getUTCTimeMillis()
  6. roundMicrosToMillis(String micros)
  7. currentDateMillis()