Package com.ibm.icu.text

Examples of com.ibm.icu.text.TimeZoneNames$DefaultTimeZoneNames


      // Specific format
      assert (style == LONG || style == SHORT || style == SHORT_COMMONLY_USED);

      // Gets the name directly from TimeZoneNames
      long date = System.currentTimeMillis();
      TimeZoneNames tznames = TimeZoneNames.getInstance(locale);
      NameType nameType = null;
      switch (style) {
      case LONG:
        nameType = daylight ? NameType.LONG_DAYLIGHT : NameType.LONG_STANDARD;
        break;
      case SHORT:
      case SHORT_COMMONLY_USED:
        nameType = daylight ? NameType.SHORT_DAYLIGHT : NameType.SHORT_STANDARD;
        break;
      }
      result = tznames.getDisplayName(ZoneMeta.getCanonicalCLDRID(this), nameType, date);
      if (result == null) {
        // Fallback to localized GMT
        TimeZoneFormat tzfmt = TimeZoneFormat.getInstance(locale);
        int offset = daylight && useDaylightTime() ? getRawOffset() + getDSTSavings() : getRawOffset();
        result = (style == LONG) ? tzfmt.formatOffsetLocalizedGMT(offset) : tzfmt.formatOffsetShortLocalizedGMT(offset);
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.TimeZoneNames$DefaultTimeZoneNames

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.