Returns the default parse options used by this <code>TimeZoneFormat</code> instance.
@return the default parse options.
@see ParseOption
510603
public EnumSet<ParseOption> getDefaultParseOptions() {
        if (_parseAllStyles && _parseTZDBNames) {
            return EnumSet.of(ParseOption.ALL_STYLES, ParseOption.TZ_DATABASE_ABBREVIATIONS);
        } else if (_parseAllStyles) {
            return EnumSet.of(ParseOption.ALL_STYLES);
        } else if (_parseTZDBNames) {
            return EnumSet.of(ParseOption.TZ_DATABASE_ABBREVIATIONS);
        }
        return EnumSet.noneOf(ParseOption.class);
    }
1014689
def parse_timezone(tzstring, default_timezone=UTC):
    
    if tzstring == "Z":
        return default_timezone
    # This isn't strictly correct, but it's common to encounter dates without
    # timezones so I'll assume the default (which defaults to UTC).
    # Addresses issue 4.
    if tzstring is None:
        return default_timezone
    m = TIMEZONE_REGEX.match(tzstring)
    prefix, hours, minutes = m.groups()
    hours, minutes = int(hours), int(minutes)
    if prefix == "-":
        hours = -hours
        minutes = -minutes
    return FixedOffset(hours, minutes, tzstring)
571334
private static DateFormat getDateFormat() {
		if (IS_JAVA7) {
			SoftReference<DateFormat> softReference = THREAD_LOCAL_DF.get();
			if (softReference != null) {
				DateFormat dateFormat = softReference.get();
				if (dateFormat != null) {
					return dateFormat;
				}
			}
			DateFormat result = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.US);
			softReference = new SoftReference<DateFormat>(result);
			THREAD_LOCAL_DF.set(softReference);
			return result;
		} else {
			throw new RuntimeException("Error parsing XES log. This method should not be called unless running on Java 7!");
		}
	}
282858
public static String[][] getZoneStrings(Locale locale) {
        if (locale == null) {
            locale = Locale.getDefault();
        }
        return cachedZoneStrings.get(locale);
    }
1060776
@Override
    public String[] getOptionValues() {
        String[] values = new String[valueOptions.size()];
        for (int i = 0; i < values.length; i++) {
            values[i] = valueOptions.get(i)[0];
        }
        return values;
    }
720349
private DateFormat parseFormatter(Context context, Arguments args)
    {
        final String format = args.get(FORMAT_PARAM_NAME);
        final Locale locale = context.get(LOCALE);
        if (format != null)
        {
            return new SimpleDateFormat(format, locale);
        }

        final int defaultFormatStyle = parseDateFormatStyle(args);
        final int dateFormatStyle = parseDateFormatStyle(args.get(DATE_PARAM_NAME), defaultFormatStyle);
        final int timeFormatStyle = parseDateFormatStyle(args.get(TIME_PARAM_NAME), defaultFormatStyle);

        if (Mode.DATE_TIME.equals(mode))
        {
            return DateFormat.getDateTimeInstance(dateFormatStyle, timeFormatStyle, locale);
        }
        else if (Mode.DATE.equals(mode))
        {
            return DateFormat.getDateInstance(dateFormatStyle, locale);
        }
        else if (Mode.TIME.equals(mode))
        {
            return DateFormat.getTimeInstance(timeFormatStyle, locale);
        }
        return DateFormat.getInstance();
    }
148371
public static DateFormat getDateFormatter() {
        SoftReference<DateFormat> ref = dateFormatter.get();
        DateFormat formatter = ref != null ? ref.get() : null;
        if (formatter == null) {
            formatter = new SimpleDateFormat(DATE_FORMAT);
            formatter.setCalendar(new GregorianCalendar(new SimpleTimeZone(0, "GMT")));
            dateFormatter.set(new SoftReference<DateFormat>(formatter));
        }
        return formatter;
    }
1020153
@Nonnull
  public static ESuccess setDefaultDateTimeZoneID (@Nonnull @Nonempty final String sDateTimeZoneID)
  {
    ValueEnforcer.notEmpty (sDateTimeZoneID, "DateTimeZoneID");

    try
    {
      // Try to resolve ID -> throws exception if unknown
      final ZoneId aDefaultZoneId = ZoneId.of (sDateTimeZoneID);

      // getTimeZone falls back to GMT if unknown
      final TimeZone aDefaultTimeZone = TimeZone.getTimeZone (aDefaultZoneId);

      s_aDefaultZoneId = aDefaultZoneId;
      TimeZone.setDefault (aDefaultTimeZone);
      return ESuccess.SUCCESS;
    }
    catch (final DateTimeException ex)
    {
      // time zone ID is unknown
      LOGGER.warn ("Unsupported ZoneId '" + sDateTimeZoneID + "'", ex);
      return ESuccess.FAILURE;
    }
  }
1064460
public function getOptionParser() {
		$parser = parent::getOptionParser();
		$parser->addOption('range', array(
					'help' => 'Either a date range (separator "-") in format ' . Configure::read('Task.dateFormat')
				))
				->addOption('interval', array(
					'help' => 'Interval in date time format (for ex: 15 minutes, 1 hour, 2 days). Defaults 1 day'
				))
				->addOption('debug', array(
					'help' => 'Sets debug level',
					'short' => 'd',
					'default' => Configure::read('debug')
		));
		if (CakePlugin::loaded('Task')) {
			$parser->addOption('scheduled', array(
						'help' => 'If set then script will be run by task daemon',
						'boolean' => true
					))
					->addOption('scheduled-no-split', array(
						'help' => 'If set then script will not be splitten by arguments',
						'boolean' => true
					))
					->addOption('scheduled-process-timeout', array(
						'help' => 'Sets task process timeout',
						'default' => Configure::read('Task.timeout')
					))
					->addOption('scheduled-depends-on', array(
						'help' => 'Tasks ids that must be done before current task can start. Format: coma separated',
					))
					->addOption('scheduled-wait-prev', array(
						'help' => 'If `yes` each task will wait for previous task, else each task will run independenly. 
						See `$_scheduleNextTaskDependsOnPrevious` for script defaults that used when this parameter 
						was omitted.',
			));
		} else {
			$parser->epilog($parser->epilog() . "\n" . 'For using `scheduled` install and enable Task plugin https://github.com/imsamurai/cakephp-task-plugin');
		}
		return $parser;
	}
470003
private String getOptionsForLanguage(Locale setLocale) {

        // get available locales from the workplace manager
        List<Locale> locales = OpenCms.getWorkplaceManager().getLocales();
        StringBuffer resultBuffer = new StringBuffer();
        int counter = 0;
        Iterator<Locale> i = locales.iterator();
        while (i.hasNext()) {
            Locale currentLocale = i.next();
            // add all locales to the select box
            String language = currentLocale.getDisplayLanguage(setLocale);
            if (CmsStringUtil.isNotEmpty(currentLocale.getCountry())) {
                language = language + " (" + currentLocale.getDisplayCountry(setLocale) + ")";
            }
            if (CmsStringUtil.isNotEmpty(currentLocale.getVariant())) {
                language = language + " (" + currentLocale.getDisplayVariant(setLocale) + ")";
            }
            if (counter != 0) {
                resultBuffer.append("|");
            }
            resultBuffer.append(currentLocale.toString()).append(":").append(language);
            counter++;
        }
        return resultBuffer.toString();
    }
1209134
private SimpleDateFormat getDateTimeFormatter() {
		SimpleDateFormat formatter = new SimpleDateFormat();
		formatter.applyPattern("yyyy-MM-dd'T'HH:mm:ss");
		formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
		return formatter;
	}
273900
public function getDateTimePickerOptions()
    {
        if (! isset($this->dateTimePickerOptions['language']))
            $this->dateTimePickerOptions['language'] = config('app.locale');

        $available = ['en', 'pl', 'sv', 'de'];
        $this->dateTimePickerOptions['language'] =
            in_array($this->dateTimePickerOptions['language'], $available)
                ? $this->dateTimePickerOptions['language'] : 'en';

        return $this->dateTimePickerOptions;
    }
394657
public static SimpleDateFormat getDateFormat(TimeType timeType) {
        if (timeType == null) {
            timeType = TimeType.DEFAULT;
        }
        SimpleDateFormat sdf = simpleDateFormatMap.get(timeType);
        if (sdf == null) {
            sdf = new SimpleDateFormat(timeType.getType());
            simpleDateFormatMap.put(timeType, sdf);
        }
        return sdf;
    }
357250
public static DateTimeFormatter timeFormatterWithOptionalMilliseconds() {
        // This is the .SSS part
        DateTimeParser ms = new DateTimeFormatterBuilder()
                .appendLiteral(".")
                .appendFractionOfSecond(1, 3)
                .toParser();

        return new DateTimeFormatterBuilder()
                .append(DateTimeFormat.forPattern(ES_DATE_FORMAT_NO_MS).withZoneUTC())
                .appendOptional(ms)
                .toFormatter();
    }
355273
public TimeZone getTimeZone()
    {
        if ( fDateFormat != null ) {
            // Here we clone, like other getters here, but unlike
            // DateFormat.getTimeZone() and Calendar.getTimeZone()
            // which return the TimeZone from the Calendar's zone variable
            return (TimeZone)(fDateFormat.getTimeZone().clone());
        }
        // If fDateFormat is null (unexpected), return default timezone.
        return TimeZone.getDefault();
    }
961479
public static String changeFormatAndTimeZoneToDefaultUtcFormat(
            String dateFormat, String zoneId, String dateString) {
        return JMOptional.getOptional(zoneId)
                .map(zId -> getTimeAsDefaultUtcFormat(
                        changeTimestampToLong(dateFormat,
                                dateString, zoneId)))
                .orElseGet(() -> changeFormatAndTimeZoneToDefaultUtcFormat(
                        dateFormat, dateString));
    }
476699
protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            parser.accepts(OPT_HEAD_META_SET, "metadata key-file pairs")
                  .withOptionalArg()
                  .describedAs("meta-key>=<meta-file")
                  .withValuesSeparatedBy(',')
                  .ofType(String.class);
            AdminParserUtils.acceptsUrl(parser);
            // optional options
            AdminParserUtils.acceptsNodeMultiple(parser); // either
                                                          // --node or
                                                          // --all-nodes
            AdminParserUtils.acceptsAllNodes(parser); // either --node or
                                                      // --all-nodes
            AdminParserUtils.acceptsConfirm(parser);
            return parser;
        }