package protected, for access from FastDateFormat; do not make public or protected
328986
F getDateTimeInstance(final int dateStyle, final int timeStyle, final TimeZone timeZone, final Locale locale) {
		return getDateTimeInstance(Integer.valueOf(dateStyle), Integer.valueOf(timeStyle), timeZone, locale);
	}
211883
private String formatSecondaryDate(@NonNull Calendar date) {
        if(secondaryDateFormat == null)
            return DateUtils.formatDateTime(getContext(), date.getTimeInMillis(),
                    DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE);
        else
            return secondaryDateFormat.format(date.getTime());
    }
1034429
function getModelFormat(oType) {
		var sPattern = "HH:mm:ss",
			iPrecision;

		if (!oType.oModelFormat) {
			iPrecision = oType.oConstraints && oType.oConstraints.precision;
			if (iPrecision) {
				sPattern += "." + "".padEnd(iPrecision, "S");
			}
			oType.oModelFormat = DateFormat.getTimeInstance({pattern : sPattern,
				strictParsing : true, UTC : true});
		}
		return oType.oModelFormat;
	}
963601
private StringBuffer format(Date date, StringBuffer toAppendTo,
                                FieldDelegate delegate) {
        // Convert input date to time field list
        calendar.setTime(date);

        boolean useDateFormatSymbols = useDateFormatSymbols();

        for (int i = 0; i < compiledPattern.length; ) {
            int tag = compiledPattern[i] >>> 8;
            int count = compiledPattern[i++] & 0xff;
            if (count == 255) {
                count = compiledPattern[i++] << 16;
                count |= compiledPattern[i++];
            }

            switch (tag) {
            case TAG_QUOTE_ASCII_CHAR:
                toAppendTo.append((char)count);
                break;

            case TAG_QUOTE_CHARS:
                toAppendTo.append(compiledPattern, i, count);
                i += count;
                break;

            default:
                subFormat(tag, count, delegate, toAppendTo, useDateFormatSymbols);
                break;
            }
        }
        return toAppendTo;
    }
991037
public static String getDateTimeFormatString(ULocale loc, String calType, int dateStyle,
            int timeStyle) {
        if (timeStyle < DateFormat.NONE || timeStyle > DateFormat.SHORT) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
        if (dateStyle < DateFormat.NONE || dateStyle > DateFormat.SHORT) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }

        PatternData patternData = PatternData.make(loc, calType);

        // Resolve a pattern for the date/time style
        String pattern = null;
        if ((timeStyle >= 0) && (dateStyle >= 0)) {
            pattern = SimpleFormatterImpl.formatRawPattern(
                    patternData.getDateTimePattern(dateStyle), 2, 2,
                    patternData.patterns[timeStyle],
                    patternData.patterns[dateStyle + 4]);
        } else if (timeStyle >= 0) {
            pattern = patternData.patterns[timeStyle];
        } else if (dateStyle >= 0) {
            pattern = patternData.patterns[dateStyle + 4];
        } else {
            throw new IllegalArgumentException("No date or time style specified");
        }
        return pattern;
    }
829558
public function convertToFormattedDbDate()
    {
        $this->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->rawValue), self::T_RAW);
    }
942647
static final java.util.Date parseDate(String formatted) {
        if (formatted == null || formatted.trim().equals(""))
            return null;

        try {
            DatatypeFactory factory = DatatypeFactory.newInstance();
            XMLGregorianCalendar calendar = factory.newXMLGregorianCalendar(formatted);
            return calendar.toGregorianCalendar().getTime();
        }
        catch (Exception e) {
            Matcher matcher = PATTERN_DD_MM_YYYY.matcher(formatted);

            // Try matching dd.MM.yyyy date formats first
            if (matcher.find()) {
                String yyyy = matcher.group(3);
                String mm = matcher.group(2);
                String dd = matcher.group(1);
                String hh = defaultIfEmpty(matcher.group(4), "0");
                String min = defaultIfEmpty(matcher.group(5), "0");
                String ss = defaultIfEmpty(matcher.group(6), "0");
                String ms = defaultIfEmpty(matcher.group(7), "0");

                return getDate(Integer.parseInt(yyyy),
                               Integer.parseInt(mm),
                               Integer.parseInt(dd),
                               Integer.parseInt(hh),
                               Integer.parseInt(min),
                               Integer.parseInt(ss),
                               Integer.parseInt(ms));
            }

            // Then try matching yyyy-MM-dd date formats
            else {
                Matcher matcher2 = PATTERN_YYYY_MM_DD.matcher(formatted);

                if (matcher2.find()) {
                    String yyyy = matcher2.group(1);
                    String mm = defaultIfEmpty(matcher2.group(2), "1");
                    String dd = defaultIfEmpty(matcher2.group(3), "1");
                    String hh = defaultIfEmpty(matcher2.group(4), "0");
                    String min = defaultIfEmpty(matcher2.group(5), "0");
                    String ss = defaultIfEmpty(matcher2.group(6), "0");
                    String ms = defaultIfEmpty(matcher2.group(7), "0");

                    return getDate(Integer.parseInt(yyyy),
                                   Integer.parseInt(mm),
                                   Integer.parseInt(dd),
                                   Integer.parseInt(hh),
                                   Integer.parseInt(min),
                                   Integer.parseInt(ss),
                                   Integer.parseInt(ms));
                }

                // Finally, try matching plain timestamps
                else {
                    try {
                        return new Date(Long.parseLong(formatted));
                    } catch (NumberFormatException ignore) {
                        return null;
                    }
                }
            }
        }
    }
826787
@Override
    protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
    {
        SerializerProvider prov = visitor.getProvider();
        if ((prov != null) && useNanoseconds(prov)) {
            JsonNumberFormatVisitor v2 = visitor.expectNumberFormat(typeHint);
            if (v2 != null) {
                v2.numberType(NumberType.BIG_DECIMAL);
            }
        } else {
            JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint);
            if (v2 != null) {
                v2.numberType(NumberType.LONG);
            }
        }
    }
821724
public static FastDateFormat getDateInstance(final int style, final Locale locale) {
		return cache.getDateInstance(style, null, locale);
	}
1068882
@Override
  public final String toIso8601DateTimeSecNoTz(final Date pDate,
    final Map<String, Object> pAddParam) throws Exception {
    return this.dateTimeSecNoTzFormatIso8601.format(pDate);
  }
499742
private void _serializeDateTime(DateTime dateTime, StringBuilder sb) throws ConverterException {

	try {
	    TimeZone tz = ThreadLocalPageContext.getTimeZone();
	    sb.append(goIn());
	    sb.append("createDateTime(");
	    sb.append(DateFormat.call(null, dateTime, "yyyy,m,d", tz));
	    sb.append(',');
	    sb.append(TimeFormat.call(null, dateTime, "H,m,s,l,", tz));
	    sb.append('"').append(tz.getID()).append('"');
	    sb.append(')');
	}
	catch (PageException e) {
	    throw toConverterException(e);
	}
    }
1192066
static DateFiller parseDateParameter(String wrappedParameter, String trimmedParameter) {
    if (trimmedParameter.startsWith(PARAMETER_DATE + " ")
        && trimmedParameter.length() > PARAMETER_DATE.length() + 1) {
      String dateFormat = trimmedParameter.substring(PARAMETER_DATE.length() + 1);
      return new DateFiller(wrappedParameter, trimmedParameter, dateFormat);
    } else if (trimmedParameter.equals(PARAMETER_DATE)) {
      return new DateFiller(wrappedParameter, trimmedParameter, DEFAULT_DATE_FORMAT);
    }
    return null;
  }
665071
public static SimpleDateFormat getSimpleDateFormat(String dateFormat,
            String zoneId) {
        return JMMap.getOrPutGetNew(simpleDateFormatMap,
                buildSimpleDateFormatKey(dateFormat, zoneId),
                newSimpleDateFormatBuilder.apply(dateFormat, zoneId));
    }
1324545
public static String formatDate(@NotNull String pattern, @NotNull Date date) {
		return FastDateFormat.getInstance(pattern).format(date);
	}
778944
static public String getFormattedTime(long dt, String format, boolean isTime)
    {
        String ret = "";
        SimpleDateFormat df = null;

        try
        {
            if(dt > 0)
            {
                df = formatPool.getFormat(format);
                if(isTime)
                    df.setTimeZone(DateUtilities.getCurrentTimeZone());
                else
                    df.setTimeZone(DateUtilities.defaultTZ);
                ret = df.format(new Date(dt));
            }
        }
        catch(Exception e)
        {
        }

        if(df != null)
            formatPool.release(df);

        return ret;
    }
1321123
synchronized static private byte[] getSecret() throws Exception {
		if( null == secret ) {
			Date now = new Date();
			long nowValue = now.getTime();
			
			byte[] nowBytes = new byte[8];
			nowBytes[0] = (byte)((nowValue >>  0) & 0xff);
			nowBytes[1] = (byte)((nowValue >>  8) & 0xff);
			nowBytes[2] = (byte)((nowValue >> 16) & 0xff);
			nowBytes[3] = (byte)((nowValue >> 24) & 0xff);
			nowBytes[4] = (byte)((nowValue >> 32) & 0xff);
			nowBytes[5] = (byte)((nowValue >> 40) & 0xff);
			nowBytes[6] = (byte)((nowValue >> 48) & 0xff);
			nowBytes[7] = (byte)((nowValue >> 56) & 0xff);
			
			MessageDigest md = MessageDigest.getInstance("SHA");
			md.update( nonce );
			md.update( nowBytes );
			secret = md.digest();
		}
		
		return secret;
	}
39330
private boolean isThisDateValid(String dateToValidate, String dateFromat) {
        if (dateToValidate == null) {
            return false;
        }
        SimpleDateFormat sdf = new SimpleDateFormat(dateFromat);
        sdf.setLenient(false);
        try {
            //if not valid, it will throw ParseException
            Date date = sdf.parse(dateToValidate);
        } catch (ParseException e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }