I’m trying to get the timezone in android
Calendar cal = Calendar.getInstance();
TimeZone tz = cal.getTimeZone();
System.out.println("timezone = " + tz.toString());
I should be getting
sun.util.calendar.ZoneInfo[id="Europe/London",offset=0,dstSavings=3600000 .....
But when i print in ddms i get the below value
org.apache.harmony.luni.internal.util.ZoneInfo@9e54425b
According to the android documentation the best way to get a text representation of a
TimeZoneis by usinggetDisplayName.For the Olsen name, you can use TimeZone.getID.