Java TimeZone .getDisplayName ( boolean daylight, int style)
Syntax
TimeZone.getDisplayName(boolean daylight, int style) has the following syntax.
public final String getDisplayName(boolean daylight, int style)
Example
In the following code shows how to use TimeZone.getDisplayName(boolean daylight, int style) method.
//from w w w. java 2 s . c o m
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(true,TimeZone.LONG);
// checking display name
System.out.println("Display name is :" + disname);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.util »
Java Tutorial »
java.util »