Java Date Time - Java TimeZone .getDisplayName ( boolean daylight, int style, Locale locale)








Syntax

TimeZone.getDisplayName(boolean daylight, int style, Locale locale) has the following syntax.

public String getDisplayName(boolean daylight,   int style,   Locale locale)

Example

In the following code shows how to use TimeZone.getDisplayName(boolean daylight, int style, Locale locale) method.

//from   w w  w  . j ava 2s  .  co  m
import java.util.Locale;
import java.util.TimeZone;

public class Main {
   public static void main( String args[] ){
       
      // create default time zone object
      TimeZone timezone = TimeZone.getTimeZone("US");
      
      // get display name for specific locale
      String disname=timezone.getDisplayName(true,1,new Locale("EN","US"));       
         
      // checking display name         
      System.out.println("Display name is :" + disname);
   }    
}

The code above generates the following result.