String timeZoneStr = "Asia/Calcutta";
String shortDisplayName = TimeZone.getTimeZone(timeZoneStr).getDisplayName(false, TimeZone.SHORT);
Here first boolean param indicates daylight saving on/off and TimeZone.SHORT indicates a style specifier for getDisplayName() indicating a short name, such as "IST."
No comments:
Post a Comment