Example usage for android.util TimeUtils getTimeZone

List of usage examples for android.util TimeUtils getTimeZone

Introduction

In this page you can find the example usage for android.util TimeUtils getTimeZone.

Prototype

public static java.util.TimeZone getTimeZone(int offset, boolean dst, long when, String country) 

Source Link

Document

Tries to return a time zone that would have had the specified offset and DST value at the specified moment in the specified country.

Usage

From source file:Main.java

private static TimeZone guessTimeZone(Calendar c, String country) {
    return TimeUtils.getTimeZone(c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET),
            c.get(Calendar.DST_OFFSET) != 0, c.getTimeInMillis(), country);
}