Pages

July 22, 2011

Android TimeZone in GMT format - Code Snippet

Code Snippet :
TimeZone tz = TimeZone.getDefault();
String gmt=TimeZone.getTimeZone(tz.getID()).getDisplayName(false,TimeZone.SHORT)        
Log.d("Tag","TimeZone : "+gmt);

Output :
07-22 13:51:51.221: DEBUG/Tag(2910): TimeZone : GMT+05:30