MCPcopy Create free account
hub / github.com/apache/freemarker / formatDate

Method formatDate

src/main/java/freemarker/core/Environment.java:773–779  ·  view source on GitHub ↗
(Date date, int type)

Source from the content-addressed store, hash-verified

771 }
772
773 String formatDate(Date date, int type) throws TemplateModelException {
774 DateFormat df = getDateFormatObject(type);
775 if(df == null) {
776 throw new TemplateModelException("Can't convert the date to string, because it is not known which parts of the date variable are in use. Use ?date, ?time or ?datetime built-in, or ?string.<format> or ?string(format) built-in with this date.");
777 }
778 return df.format(date);
779 }
780
781 public void setTimeFormat(String formatName) {
782 super.setTimeFormat(formatName);

Callers 1

getStringValueMethod · 0.80

Calls 2

getDateFormatObjectMethod · 0.95
formatMethod · 0.80

Tested by

no test coverage detected