Example usage for java.time ZoneId getDisplayName

List of usage examples for java.time ZoneId getDisplayName

Introduction

In this page you can find the example usage for java.time ZoneId getDisplayName.

Prototype

public String getDisplayName(TextStyle style, Locale locale) 

Source Link

Document

Gets the textual representation of the zone, such as 'British Time' or '+02:00'.

Usage

From source file:Main.java

public static void main(String[] args) {
    ZoneId z = ZoneId.systemDefault();

    System.out.println(z.getDisplayName(TextStyle.FULL, Locale.CANADA));
}

From source file:org.geoname.parser.TimeZoneDisplay.java

public TimeZoneDisplay(final ZoneId zoneId) {
    if (zoneId == null) {
        throw new IllegalArgumentException("Cannot use null time zone");
    }//from w  w w .  j a v  a  2s.  c  om
    timeZoneId = zoneId.getId();
    timeZoneDisplayName = zoneId.getDisplayName(TextStyle.FULL, Locale.getDefault());
    description = createDescription();
}