get Time Zone Hours Offset - Android java.util

Android examples for java.util:Timezone

Description

get Time Zone Hours Offset

Demo Code


//package com.java2s;

import android.text.format.DateUtils;

import java.util.TimeZone;

public class Main {
    public static int getTimeZoneHoursOffset() {
        return TimeZone.getDefault().getRawOffset()
                / (int) DateUtils.HOUR_IN_MILLIS;
    }/*from  w  w  w.  j  a v a 2  s  .  c  o m*/
}

Related Tutorials