转换日期到字符串。

@param date
日期。
@param format
格式，形式见 {@code org.joda.time.format.DateTimeFormat}。
@return 字符串
488529
public static String format(final Calendar date, final String format) {
		return format(date.getTime(), format);
	}
63310
public static String formatDate(int style,Date date){
		if (date == null) {
			return "";
		}
		if (style < 0) {
			style = DateFormat.DEFAULT;
		}
		return DateFormat.getDateInstance(style).format(date);
	}
542988
public String date (String format, Object arg)
    {
        Date when = massageDate(arg);
        if (when == null) {
            return format;
        }
        SimpleDateFormat fmt = new SimpleDateFormat(format, getLocale());
        return fmt.format(when);
    }
679407
public static String format( TimeZone timeZone, Date date ) {
        return format( DateFormat.DATE_FORMAT_STR_ISO8601, timeZone, date );
    }
202741
public LambdaDslJsonArray time(final String format, final Date example) {
        pactArray.time(format, example);
        return this;
    }
102185
public static String format(Date date) {
    Calendar calendar = new GregorianCalendar(TIMEZONE_Z, Locale.US);
    calendar.setTime(date);

    // estimate capacity of buffer as close as we can (yeah, that's pedantic ;)
    int capacity = "yyyy-MM-ddThh:mm:ss.sssZ".length();
    StringBuilder formatted = new StringBuilder(capacity);
    padInt(formatted, calendar.get(Calendar.YEAR), "yyyy".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.MONTH) + 1, "MM".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.DAY_OF_MONTH), "dd".length());
    formatted.append('T');
    padInt(formatted, calendar.get(Calendar.HOUR_OF_DAY), "hh".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.MINUTE), "mm".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.SECOND), "ss".length());
    formatted.append('.');
    padInt(formatted, calendar.get(Calendar.MILLISECOND), "sss".length());
    formatted.append('Z');
    return formatted.toString();
  }
1324545
public static String formatDate(@NotNull String pattern, @NotNull Date date) {
		return FastDateFormat.getInstance(pattern).format(date);
	}
1149927
public static String format(final Date date, final String format) {
		return format(date.getTime(), format);
	}
194030
public static String formatDate(Date date) {
        return org.apache.http.client.utils.DateUtils.formatDate(date);
    }
486059
public static String format( DateTimeFormat format, TimeZone timeZone, Date date ) {
        return format.format( date, timeZone );
    }
928768
public static String format(Date date, DateFormat format) {
		if (null == format || null == date) {
			return null;
		}
		return format.format(date);
	}
1329322
public static String format( DateTimeFormat format, Date date ) {
        return format( format, UTC_TIMEZONE, date );
    }
1358573
public String getAmazonDateString(Date date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone(TIME_ZONE));
        return simpleDateFormat.format(date);
    }
890647
private String convertDate(Date date) {
        return android.text.format.DateFormat.format("yyyy-MM-dd", date).toString();
    }
360791
public static String getFormatDate(String format, String zoneId) {
        return getFormatDate(format, new Date(), zoneId);
    }
57247
public static String formatDate(final Date date) {
        
        ArgUtils.notNull(date, "date");
        
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        format.setTimeZone(TimeZone.getTimeZone("GMT-00:00"));
        return format.format(date);
        
    }
1225648
public PactDslJsonArray timestamp(String format, Date example) {
        FastDateFormat instance = FastDateFormat.getInstance(format);
        body.put(instance.format(example));
        matchers.addRule(rootPath + appendArrayIndex(0), matchTimestamp(format));
        return this;
    }