Java Date Time - Java TimeZone.getDisplayName()








Syntax

TimeZone.getDisplayName() has the following syntax.

public final String getDisplayName()

Example

In the following code shows how to use TimeZone.getDisplayName() method.

/*from   w  w  w  .j a  v a2s.c  om*/

import java.util.TimeZone;

public class Main {
   public static void main( String args[] ){
       
      // create default time zone object
      TimeZone timezonedefault = TimeZone.getDefault();
      
      // get display name
      String disname=timezonedefault.getDisplayName(); 
   
      // checking display name         
      System.out.println("Display name is :" + disname);
   }    
}

The code above generates the following result.