Android examples for java.util:Calendar
Returns the ID of this TimeZone, such as America/Los_Angeles, GMT-08:00 or UTC.
import java.util.Calendar; public class Main { /**//from w ww . j av a2s. c om * Returns the ID of this TimeZone, such as America/Los_Angeles, GMT-08:00 or * UTC. * * @return */ public static final String obtainTimeZone() { String zone = null; try { zone = Calendar.getInstance().getTimeZone().getID(); } catch (Exception e) { } if (zone == null) { zone = ""; } return zone; } }