I need to show the device current time zone in short form. (For ex: IST for India Standard Time).
Below method returns full name of time zone. (i.e India Standard Time)
public static String getTimeZoneShortName() {
return Calendar.getInstance().getTimeZone().getDisplayName();
}
Below method gives the timezone in short form if I use it in a Java program. But it gives the output as "GMT+5:30" on Android.
public static String getTimeZoneShortName() {
return Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT);
}
I need to show only the short form of the zone. How do I do it in Android?
– tom1988 Oct 17 '16 at 11:08