/*
@see com.ibm.websphere.http.HttpDateFormat#parseASCIITime(java.lang.String)
766422
@Override
    public Date parseASCIITime(String input) throws ParseException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "ascii parsing [" + input + "]");
        }
        Date d = attemptParse(getFormat().getAsciiParse(), input);
        if (null == d) {
            throw new ParseException("Unparseable [" + input + "]", 0);
        }
        return d;
    }
342603
public static DateTime iso8601DateTimeFromString(String dateTimeString) {
        try {
            return DateTime.parse(dateTimeString, ISO8601_DATE_TIME_FORMATTER);
        } catch (Exception e) {
            return null;
        }
    }
907735
public static final Date parseDateTime(String value)
   {
      Date result = null;

      try
      {
         if (value != null && !value.isEmpty())
         {
            result = DATE_TIME_FORMAT.get().parse(value);
         }
      }
      catch (ParseException ex)
      {
         // Ignore
      }

      return result;
   }
1161706
public static long generateDatumTime(long initializeTime, TimeUnit unit) throws ParseException
    {
        // 初期に生成するファイル名称を基準となる値にするため、ファイル切替インターバル（単位）より１つ大きな単位を取得し
        // １つ大きな単位をベースに時刻を算出する。
        // 例：10分間隔であれば「0.10.20....」というのが基準となる値。
        SimpleDateFormat parentDateFormat = new SimpleDateFormat(
                TimeUnitUtil.getDatePattern(TimeUnitUtil.getParentUnit(unit)));

        // １つ大きな単位をベースに基準時刻を取得し、初期生成ファイル名称用の日時を算出する。
        // 例：10分間隔をインターバルとし、8:35を起動時刻とした場合、8:00を基準時刻とする。
        String datumTimeString = parentDateFormat.format(new Date(initializeTime));

        long datumTime = parentDateFormat.parse(datumTimeString).getTime();
        return datumTime;
    }
283527
public static Date stringToCustomDateTime(SimpleDateFormat sdf, String datetime) throws ParseException {
        return sdf.parse(datetime.trim());
    }
1023847
public static Date parseFromIso8601(String s) {
        synchronized (MONITOR) {
            try {
                return ISO8601.parse(s);
            } catch (ParseException e) {
                throw new IllegalArgumentException("Unable to parse date", e);
            }
        }
    }
1126643
public static String getStringFromDateTime(Date date) throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZone);
        return formatter.format(date);
    }
476929
public static final Date parseTime(String value)
   {
      Date result = null;
      if (value != null && value.length() != 0)
      {
         try
         {
            result = TIME_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // Ignore parse errors
         }
      }
      return result;
   }
1184713
@Override
    protected Object parseLiteralValue( TokenStream tokens,
                                        TypeSystem typeSystem ) {
        if (tokens.canConsume("TIMESTAMP")) {
            Position pos = tokens.previousPosition();
            // This should be a timestamp represented as a single-quoted string ...
            String value = removeBracketsAndQuotes(tokens.consume(), tokens.previousPosition());
            TypeFactory<?> dateTimeFactory = typeSystem.getDateTimeFactory();
            try {
                // Convert to a date and then back to a string to get canonical form ...
                Object dateTime = dateTimeFactory.create(value);
                return dateTime;
                // return dateTimeFactory.asString(dateTime);
            } catch (ValueFormatException e) {
                String msg = GraphI18n.expectingLiteralAndUnableToParseAsDate.text(value, pos.getLine(), pos.getColumn());
                throw new ParsingException(pos, msg);
            }
        }
        return super.parseLiteralValue(tokens, typeSystem);
    }
890844
public static final Date parseDate(String value)
   {
      Date result = null;

      try
      {
         if (value != null && !value.isEmpty())
         {
            result = DATE_FORMAT.get().parse(value);
         }
      }
      catch (ParseException ex)
      {
         // Ignore
      }

      return result;
   }
827698
public static Date decodeDate(String value) throws ParseException {
		String javaValue = value.substring(0, value.length() - DECODE_DATE_COLONS_INDEX)
				+ value.substring(value.length() - ENCODE_DATE_COLONS_INDEX);
		SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
		dateFormatter.setTimeZone(TimeZone.getTimeZone(UTC_TZ_ID));
		return dateFormatter.parse(javaValue);
	}
1305919
public void parse(String string) {
    if (string == null) {
      throw new NullPointerException("string is null");
    }
    int bufferSize = Math.max(MIN_BUFFER_SIZE, Math.min(DEFAULT_BUFFER_SIZE, string.length()));
    try {
      parse(new StringReader(string), bufferSize);
    } catch (IOException exception) {
      // StringReader does not throw IOException
      throw new RuntimeException(exception);
    }
  }
480781
@Override
  public final String toDateTimeSecString(final Date pDate,
    final Map<String, Object> pAddParam) throws Exception {
    return this.dateTimeSecFormat.format(pDate);
  }
1195789
private static Date parseDate(@SuppressWarnings("SameParameterValue") String stringDate)
    {
        try {
            return formatter.parse(stringDate);
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
880767
public static DateType parseV3(String theV3String) {
		DateType retVal = new DateType();
		retVal.setValueAsV3String(theV3String);
		return retVal;
	}
923072
public long parseLocalDate(String string) throws Exception
  {
    long time = parseDate(string);

    synchronized (this) {
      setLocalTime(time);
      return getGMTTime();
    }
  }
6567
public static Date parse(String value) {
        try {
            return STANDARD_DATE_FORMAT.get().parse(value);
        } catch (ParseException ignore) {
        }
        for (String formatString : BROWSER_COMPATIBLE_DATE_FORMATS) {
            try {
                return new SimpleDateFormat(formatString, Locale.US).parse(value);
            } catch (ParseException ignore) {
            }
        }
        return null;
    }