formats a date to a cfml date format

@param date
@param mask
@return formated date as string
177062
@Override
    public String format(Date date, String mask) {
	return format(date, mask, null);
    }
856055
public static String formatTimestamp(@Nullable Date date) {
        return (date != null) ? date.toInstant().toString() : null;
    }
1017224
public String formatDate(Date date, int type)
    {
        String string = null;
        if (type == DBConstants.DATE_TIME_FORMAT)
            string = XmlUtilities.dateTimeFormat.format(date);
        else if (type == DBConstants.DATE_ONLY_FORMAT)
            string = XmlUtilities.dateFormat.format(date);
        else if (type == DBConstants.TIME_ONLY_FORMAT)
            string = XmlUtilities.timeFormat.format(date);
        return string;
    }
240163
public static String getFormattedDate(final Long lastQueryDate, final String datePattern) {
        return formatDate(lastQueryDate, null, datePattern);
    }
1079515
public String doFormatDate(long date) {
        buf.setLength(0);
        gc.setTimeInMillis(date);

        int day_of_week = gc.get(Calendar.DAY_OF_WEEK);
        int day_of_month = gc.get(Calendar.DAY_OF_MONTH);
        int month = gc.get(Calendar.MONTH);
        int year = gc.get(Calendar.YEAR);
        int century = year / 100;
        year = year % 100;

        int hours = gc.get(Calendar.HOUR_OF_DAY);
        int minutes = gc.get(Calendar.MINUTE);
        int seconds = gc.get(Calendar.SECOND);

        buf.append(DAYS[day_of_week]);
        buf.append(',');
        buf.append(' ');
        StringUtils.append2digits(buf, day_of_month);

        buf.append(' ');
        buf.append(MONTHS[month]);
        buf.append(' ');
        StringUtils.append2digits(buf, century);
        StringUtils.append2digits(buf, year);

        buf.append(' ');
        StringUtils.append2digits(buf, hours);
        buf.append(':');
        StringUtils.append2digits(buf, minutes);
        buf.append(':');
        StringUtils.append2digits(buf, seconds);
        buf.append(" GMT");
        return buf.toString();
    }
1164068
private String convertDate(String date) {
        SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
        try {
            Date creationDate = sdf.parse(date);
            sdf = new SimpleDateFormat("\\'yr'yyyy\\'mo'MM\\'dy'dd\\'hr'HH\\'min'mm\\'sec'ss");
            return sdf.format(creationDate);
        } catch(ParseException pe) {
            pe.printStackTrace();
            return "";
        }
    }
1018457
public static String toLongFormatFromDate(Date date) {
    if (date == null) {
      return null;
    }

    return strategy.formatFor(FACEBOOK_LONG_DATE_FORMAT_WITHOUT_TIMEZONE).format(date);
  }
294796
public String formatAsString(final String formatPattern, final Date value) {
        return format(formatPattern, value).getText();
    }
1160728
public static String formatDateAsYMD(Date date) {
        String retString = "";
        if (date != null) {
            retString = JinxUtils.ymdFormatter.format(date);
        }
        return retString;
    }
343664
public String getDate(Date date) {

        return CmsDateUtil.getDate(date, DateFormat.SHORT, m_locale);
    }
1143524
public static String format(String pattern, Date date) {
	synchronized (data) {
	    Object obj = data.get(pattern);
	    if (obj != null) {
		return ((SimpleDateFormat) obj).format(date);
	    } // print.ln(pattern);
	    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
	    data.put(pattern, sdf);
	    return sdf.format(date);
	}
    }
889734
@Nonnull
    @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
    public String format(@Nonnull Date date) {
        SimpleDateFormat dateFormat = dateFormats.poll();
        if (dateFormat == null) {
            dateFormat = new SimpleDateFormat(pattern, locale);
            dateFormat.setTimeZone(timeZone);
        }
        try {
            return dateFormat.format(date);
        } finally {
            dateFormats.offer(dateFormat);
        }
    }
945253
public static String encodeDate(Date date) {
        SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
        /* Java doesn't handle ISO8601 nicely: need to add ':' manually */
        String result = dateFormatter.format(date);
        return result.substring(0, result.length() - 2) + ":" + result.substring(result.length() - 2);
    }
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();
    }
127128
public static String dateToString(final Date date, final String format) {
        if (date == null) {
            return null;
        }
        final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
        return dateFormat.format(date);
    }
488529
public static String format(final Calendar date, final String format) {
		return format(date.getTime(), format);
	}
1241476
public static String format(Date date) {
        DateFormat dateFormat = new SimpleDateFormat(DateField.FORMAT);
        return date == null ? null : dateFormat.format(date);
    }