获取日期参数。

@param request
请求
@param name
参数名
@param format
日期格式
@return 参数内容
493406
public static Date getDateParameter(final HttpServletRequest request, final String name, final String format) {
		String value = request.getParameter(name);
		if (StringUtils.isBlank(value)) {
			return null;
		}
		return new Date(DateTimeFormat.forPattern(format).parseMillis(value));
	}
606992
public LambdaDslJsonArray timestamp(final String format, final Date example) {
        pactArray.timestamp(format, example);
        return this;
    }
403998
public static String getFormatDate(String format, Date date, String zoneId) {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
        return dateTimeFormatter
            .format(date.toInstant().atZone(ZoneId.of(zoneId)).toLocalDateTime());
    }
166327
public static String getParameter(final Request request, final String parameterName)
	{
		String parameterValue = request.getRequestParameters().getParameterValue(parameterName)
			.toString();
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getPostParameters().getParameterValue(parameterName)
				.toString();
		}
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getQueryParameters().getParameterValue(parameterName)
				.toString();
		}
		if ((parameterValue == null) || parameterValue.isEmpty())
		{
			parameterValue = request.getRequestParameters().getParameterValue(parameterName)
				.toString();
		}
		return parameterValue;
	}
1218266
public LambdaDslObject date(String name, String format) {
        object.date(name, format);
        return this;
    }
646292
public static DateTime getDateTimeParameter(final HttpServletRequest request, final String name, final String format) {
		String value = request.getParameter(name);
		if (StringUtils.isBlank(value)) {
			return null;
		}
		return DateTimeFormat.forPattern(format).parseDateTime(value);
	}
758271
public void addDateField(String name, long date)
    {
        if (_dateBuffer==null)
        {
            _dateBuffer=new StringBuffer(32);
            _calendar=new HttpCal();
        }
        _dateBuffer.setLength(0);
        _calendar.setTimeInMillis(date);
        formatDate(_dateBuffer, _calendar, false);
        add(name, _dateBuffer.toString());
    }
1206859
@NonNull
    public static String getNowDateTime(@NonNull String format) {
        SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
        Date curDate = new Date(System.currentTimeMillis());
        return formatter.format(curDate);
    }
401279
private static int getStyle(String name) {

        if ("default".equals(name)) {
            return (DateFormat.DEFAULT);
        } else if ("short".equals(name)) {
            return (DateFormat.SHORT);
        } else if ("medium".equals(name)) {
            return (DateFormat.MEDIUM);
        } else if ("long".equals(name)) {
            return (DateFormat.LONG);
        } else if ("full".equals(name)) {
            return (DateFormat.FULL);
        } else {
            // PENDING(craigmcc) - i18n
            throw new ConverterException("Invalid style '" + name + '\'');
        }

    }
1046486
@Deprecated
    public static Date getDateHeader(HttpMessage message, String name) throws ParseException {
        return getDateHeader(message, (CharSequence) name);
    }
928768
public static String format(Date date, DateFormat format) {
		if (null == format || null == date) {
			return null;
		}
		return format.format(date);
	}
973927
public SimpleDateFormat getFormat(String format)
    {
        SimpleDateFormat f = (SimpleDateFormat)get();
        f.applyPattern(format);
        return f;
    }
978304
public static Date fromString(String source, String format) {
        try {
            ObjectPool<DateFormat> pool = cachedDateFormat.get(format);
            try {
                DateFormat df = pool.borrowObject();
                try {
                    return df.parse(source);
                } finally {
                    pool.returnObject(df);
                }
            } catch (Exception e) {
                throw e instanceof RuntimeException ? (RuntimeException) e
                        : new RuntimeException(e);
            }
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }
    }
488529
public static String format(final Calendar date, final String format) {
		return format(date.getTime(), format);
	}
1056259
public synchronized static String formatLocal(long gmtTime, String format)
  {
    _localDate.setGMTTime(gmtTime);

    return _localDate.format(new CharBuffer(), format).toString();
  }
1229309
public String formatDate(String format, Locale loc) {
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.putSingle("format", format);
		params.putSingle("locale", loc == null ? null : loc.toString());
		return getEntity(invokeGet("utils/formatdate", params), String.class);
	}
389991
public static Map<String, Format> get(String name)
    {
        return instance().methods.get(name);
    }