<p>Format date for file name ddMMyy, 310118.</p>
@param pDate date
@param pAddParam additional params
@return ddMMyy
@throws Exception - an exception
438304
@Override
  public final String toDdMmYy(final Date pDate,
    final Map<String, Object> pAddParam) throws Exception {
    return this.dateDdMmYy.format(pDate);
  }
742377
public GitLabApiForm withParam(String name, Date date) throws IllegalArgumentException {
        return (withParam(name, date, false));
    }
779159
public final void updateOwner(final Map<String, Object> pAddParam,
    final AdditionCostLine pEntity) throws Exception {
    String query =
    "select sum(ITSTOTAL) as ITSTOTAL from"
      + " ADDITIONCOSTLINE where ITSOWNER="
        + pEntity.getItsOwner().getItsId();
    Double total = getSrvDatabase().evalDoubleResult(query, "ITSTOTAL");
    pEntity.getItsOwner().setTotalAdditionCost(BigDecimal.valueOf(total)
.setScale(getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(),
  getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode()));
    pEntity.getItsOwner().setItsTotal(pEntity.getItsOwner()
      .getTotalMaterialsCost().add(pEntity.getItsOwner()
        .getTotalAdditionCost()).setScale(getSrvAccSettings()
      .lazyGetAccSettings(pAddParam).getCostPrecision(),
    getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode()));
    pEntity.getItsOwner().setItsCost(pEntity.getItsOwner().getItsTotal()
      .divide(pEntity.getItsOwner().getItsQuantity(),
        getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(),
          getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode()));
    getSrvOrm().updateEntity(pAddParam, pEntity.getItsOwner());
  }
168407
@Override
  public final void make(
    final Map<String, Object> pAddParam) throws Exception {
    this.replicationMethod.setLastDateReplication(new Date());
    getSrvOrm().updateEntity(pAddParam, this.replicationMethod);
  }
1197105
public static function toTz($pDate, $pTimezone = NULL)
    {
    	if ($pTimezone === NULL) {
    		$pTimezone = Agl::app()->getConfig('main/global/timezone');
    	}

    	$time_object = new DateTime($pDate, new DateTimeZone(self::DEFAULT_TZ));
	    $time_object->setTimezone(new DateTimeZone($pTimezone));
	    return $time_object->format(self::DATE_FORMAT);
    }
10934
@Override
    public void update(Object pData) throws APPErrorException {
        valid(pData);
        mDao.updateByPrimaryKey(pData);
    }
678259
public static Date toDate(final String pString, final DateFormat pFormat) {
        try {
            synchronized (pFormat) {
                // Parse date using given format
                return pFormat.parse(pString);
            }
        }
        catch (ParseException pe) {
            // Wrap in RuntimeException
            throw new IllegalArgumentException(pe.getMessage());
        }
    }
709347
public static function format($pDate, $pFormat = 'short')
    {
    	switch ($pFormat) {
    		case 'short':
    			return strftime('%x', strtotime($pDate));
    			break;
    		case 'long':
    			return strftime('%x %H:%M', strtotime($pDate));
    			break;
    		case 'full':
    			return strftime('%x %H:%M:%S', strtotime($pDate));
    			break;
    	}

    	throw new Exception("The requested date format is not correct");
    }
32446
@Override
  public final Date fromIso8601DateTimeNoTz(final String pDateStr,
    final Map<String, Object> pAddParam) throws Exception {
    return this.dateTimeNoTzFormatIso8601.parse(pDateStr);
  }
479734
public static Date strToDate(String date) throws ParseException {

        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");

        java.util.Date d = sdf.parse(date);

        return d;
    }
244086
private String utilDateToStr(Date pdt, String pstrFmt)
    {
        String strRet = null;
        SimpleDateFormat dtFmt = null;

        try
        {
            dtFmt = new SimpleDateFormat(pstrFmt);
            strRet = dtFmt.format(pdt);
        }
        catch (Exception e)
        {
            strRet = null;
        }
        finally
        {
            if (dtFmt != null) dtFmt = null;
        }
        return strRet;
    }
170021
public static String formatDate(Date argDate, String argFormat) throws Exception {
        if (argDate == null) {
            throw new Exception("参数[日期]不能为空!");
        }
        if (argFormat == null || argFormat.length() == 0) {
            argFormat = Y_M_D;
        }
        SimpleDateFormat sdfFrom = new SimpleDateFormat(argFormat);
        return sdfFrom.format(argDate).toString();
    }
463500
public static Date fromISO8601(String pDateString) {
        if (datatypeFactory != null) {
            return datatypeFactory.newXMLGregorianCalendar(pDateString.trim()).toGregorianCalendar().getTime();
        } else {
            try {
                // Try on our own, works for most cases
                String date = pDateString.replaceFirst("([+-])(0\\d)\\:(\\d{2})$", "$1$2$3");
                date = date.replaceFirst("Z$","+0000");
                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
                return dateFormat.parse(date);
            } catch (ParseException e) {
                throw new IllegalArgumentException("Cannot parse date '" + pDateString + "': " +e,e);
            }
        }
    }
2082
public synchronized static String formatAgmipDateString(String agmipDate, String format) {
        try {
            SimpleDateFormat fmt = new SimpleDateFormat(format);
            Date d = dateFormatter.parse(agmipDate);
            return fmt.format(d);
        } catch (Exception ex) {
            return null;
        }
    }
441793
@Override
  public final Long fromString(final Map<String, Object> pAddParam,
    final String pStrVal) throws Exception {
    if (pStrVal == null || "".equals(pStrVal)) {
      return null;
    }
    if (pAddParam != null) {
      String dgsep = (String) pAddParam.get("decGrSepv");
      if (dgsep != null) {
        String strVal = pStrVal.replace(dgsep, "");
        return Long.valueOf(strVal);
      }
    }
    return Long.valueOf(pStrVal);
  }
223066
private static Date parseHTTPDateImpl(final String pDate) throws NumberFormatException  {
        if (pDate == null) {
            throw new IllegalArgumentException("date == null");
        }

        if (StringUtil.isEmpty(pDate)) {
            throw new NumberFormatException("Invalid HTTP date: \"" + pDate + "\"");
        }

        DateFormat format;

        if (pDate.indexOf('-') >= 0) {
            format = HTTP_RFC850_FORMAT;
            update50YearWindowIfNeeded();
        }
        else if (pDate.indexOf(',') < 0) {
            format = HTTP_ASCTIME_FORMAT;
            update50YearWindowIfNeeded();
        }
        else {
            format = HTTP_RFC1123_FORMAT;
            // NOTE: RFC1123 always uses 4-digit years
        }

        Date date;
        try {
            //noinspection SynchronizationOnLocalVariableOrMethodParameter
            synchronized (format) {
                date = format.parse(pDate);
            }
        }
        catch (ParseException e) {
            NumberFormatException nfe = new NumberFormatException("Invalid HTTP date: \"" + pDate + "\"");
            nfe.initCause(e);
            throw nfe;
        }

        if (date == null) {
            throw new NumberFormatException("Invalid HTTP date: \"" + pDate + "\"");
        }

        return date;
    }
1368820
public static String formatRFC822Date(Date date) {
        try {
            return rfc822DateFormat.print(date.getTime());
        } catch(RuntimeException ex) {
            throw handleException(ex);
        }
    }