TimeZone getDisplayName() Method in Java with Examples
The getDisplayName() method of TimeZone class in Java is used to get a particular name of this TimeZone that is easily understood by the user. The name is appropriate for presentation and display purpose.
Syntax:
public final String getDisplayName()
Parameters: The method does not take any parameters.
Return Value: The method returns the display name of the TimeZone.
Below program illustrates the working of getDisplayName() Method of TimeZone:
import java.util.*;
public class TimeZoneDemo {
public static void main(String args[])
{
TimeZone time_zone
= TimeZone.getDefault();
System.out.println( "The TimeZone: "
+ time_zone.getDisplayName());
}
}
|
Output:
The TimeZone: Coordinated Universal Time
Last Updated :
02 Jan, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...