Java Date Time - Java TimeZone SHORT


TimeZone.SHORT has the following syntax.

public static final int SHORT


In the following code shows how to use TimeZone.SHORT field.

import java.util.TimeZone;
/*ww  w  . ja  va 2  s  . c o  m*/
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(true,TimeZone.SHORT); 
      // checking display name         
      System.out.println("Display name is :" + disname);

The code above generates the following result.