Convenience format method.

@param ref
The date of reference.
@param then
The future date.
@return a relative format date as text representation
334363
public String format(Date ref, Date then)
    {
        return prettyTime.format(DurationHelper.calculateDuration(ref, then, prettyTime.getUnits()));
    }
105349
public static String formatBetween(Date beginDate, Date endDate) {
		return formatBetween(between(beginDate, endDate, DateUnit.MS));
	}
1149927
public static String format(final Date date, final String format) {
		return format(date.getTime(), format);
	}
928768
public static String format(Date date, DateFormat format) {
		if (null == format || null == date) {
			return null;
		}
		return format.format(date);
	}
332576
void maybePrepareCall(Reference ref) {
    CallSiteType callSiteType = classifyCallSite(ref);
    callSiteType.prepare(this, ref);
  }
193827
public static String getRelativeRef(String ref) {
        Matcher matcher = match(ref);
        return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null;
    }
1206132
public String format(long timestamp) {

        // If the format is unknown, use the default formatter.
        if (invalidFormat) {
            return formatter.format(timestamp);
        }

        try {
            long delta = timestamp - refTimestamp;

            // If we need to reformat
            if (delta >= pdiff || delta < ndiff) {
                StringBuffer refTime = new StringBuffer();
                refTimestamp = timestamp;
                formatter.format(timestamp, refTime, position);

                refMilli = Long.parseLong(refTime.substring(position.getBeginIndex(), position.getEndIndex()));

                refBeginning = refTime.substring(0, position.getBeginIndex());
                refEnding = refTime.substring(position.getEndIndex());

                pdiff = 1000 - refMilli;
                ndiff = -refMilli;
                return refTime.toString();
            } else {
                StringBuffer sb = new StringBuffer();
                long newMilli = delta + refMilli;
                if (newMilli >= 100)
                    sb.append(refBeginning).append(newMilli).append(refEnding);
                else if (newMilli >= 10)
                    sb.append(refBeginning).append('0').append(newMilli).append(refEnding);
                else
                    sb.append(refBeginning).append("00").append(newMilli).append(refEnding);
                return sb.toString();

            }
        } catch (Exception e) {
            // Throw FFDC in case anything goes wrong
            // Still generate the date via the SimpleDateFormat
            invalidFormat = true;
            return formatter.format(timestamp);
        }
    }
1046269
private StringBuffer format(Calendar cal, DisplayContext capitalizationContext,
            StringBuffer toAppendTo, FieldPosition pos, List<FieldPosition> attributes) {
        // Initialize
        pos.setBeginIndex(0);
        pos.setEndIndex(0);

        // Careful: For best performance, minimize the number of calls
        // to StringBuffer.append() by consolidating appends when
        // possible.

        Object[] items = getPatternItems();
        for (int i = 0; i < items.length; i++) {
            if (items[i] instanceof String) {
                toAppendTo.append((String)items[i]);
            } else {
                PatternItem item = (PatternItem)items[i];
                int start = 0;
                if (attributes != null) {
                    // Save the current length
                    start = toAppendTo.length();
                }
                if (useFastFormat) {
                    subFormat(toAppendTo, item.type, item.length, toAppendTo.length(),
                              i, capitalizationContext, pos, cal);
                } else {
                    toAppendTo.append(subFormat(item.type, item.length, toAppendTo.length(),
                                                i, capitalizationContext, pos, cal));
                }
                if (attributes != null) {
                    // Check the sub format length
                    int end = toAppendTo.length();
                    if (end - start > 0) {
                        // Append the attribute to the list
                        DateFormat.Field attr = patternCharToDateFormatField(item.type);
                        FieldPosition fp = new FieldPosition(attr);
                        fp.setBeginIndex(start);
                        fp.setEndIndex(end);
                        attributes.add(fp);
                    }
                }
            }
        }
        return toAppendTo;

    }
869920
public static Expression nowStr(String format) {
        if (format == null || format.isEmpty()) {
            return x("NOW_STR()");
        }
        return x("NOW_STR(\"" + format + "\")");
    }
188699
public static String format(final OffsetTime self, FormatStyle timeStyle) {
        return self.format(DateTimeFormatter.ofLocalizedTime(timeStyle));
    }
333668
public static String formatDorisReturnDate(Object doirsDate, Format format) {
        if (doirsDate == null || (!(doirsDate instanceof Date))) {
            return null;
        }
        Date date = (Date) doirsDate;
        Format localFormat = (SimpleDateFormat) format;
        return localFormat.format(date);
    }
1321258
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
        if (obj instanceof Date) {
            return format((Date) obj, toAppendTo);
        } else if (obj instanceof Calendar) {
            return format((Calendar) obj, toAppendTo);
        } else if (obj instanceof Long) {
            return format(((Long) obj).longValue(), toAppendTo);
        } else {
            throw new IllegalArgumentException("Unknown class: " +
                (obj == null ? "<null>" : obj.getClass().getName()));
        }
    }
945462
def format_next(self, i):
        """"""

        c = next(i)
        return self.format_references(next(i), i) if c == '\\' else c
240163
public static String getFormattedDate(final Long lastQueryDate, final String datePattern) {
        return formatDate(lastQueryDate, null, datePattern);
    }
365351
void format(StringBuilder sb, Temporal localDate)
  {
    //Instant localDate = ClockCurrent.GMT.instant();

    int len = _timestamp.length;
    for (int j = 0; j < len; j++) {
      _timestamp[j].format(sb, localDate);
    }
  }
211883
private String formatSecondaryDate(@NonNull Calendar date) {
        if(secondaryDateFormat == null)
            return DateUtils.formatDateTime(getContext(), date.getTimeInMillis(),
                    DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE);
        else
            return secondaryDateFormat.format(date.getTime());
    }
169498
public static String formatDate(final int style, final Date value)
    {

        return context.get().formatDate(style, value);

    }