The getDisplayName(Locale locale_time) method of TimeZone class in Java is used to get a particular name of this TimeZone that is easily understood by the user in the specified locale as passed by the user. The name is appropriate for presentation and display purpose.
public final String getDisplayName(Locale locale_time)
Parameters: The method takes one parameter locale_time of Locale object type and refers to the locale into which the display name is to be supplied.
Return Value: The method returns the display name of the TimeZone in the specified locale.
Below programs illustrate the working of getDisplayName() Method of TimeZone:
The Display name for the locale is: Greenwich Mean Time
The Display name for the locale is: Australian Eastern Standard Time (New South Wales)
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.