Code example for TimeZone

Methods: getDSTSavingsgetDisplayNamegetIDgetRawOffset

0
     *  
     * @param	zone			TimeZone whose offset we want. 
     * @return					Formatted offset. 
     */ 
    public static String formatOffsetFull(TimeZone zone) {
    	String fmt = zone.getID() + ": ";
    	 
    	int base = zone.getRawOffset();
    	fmt += zone.getDisplayName(false, TimeZone.LONG) + "=UTC" + intervalMsToHmsShort(base);
    	 
    	int dst = zone.getDSTSavings();
    	if (dst != 0)
    		fmt += " (" + zone.getDisplayName(true, TimeZone.LONG) + "=UTC" + intervalMsToHmsShort(base + dst) + ")";
   	 
    	return fmt;
    } 
 
} 
 
Contextual code suggestions in your IDE  Get Codota for Java