|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.format.DateFormat
public class DateFormat
Formats numbers into the specified date format. The numbers can be
wrapped Date
objects, wrapped Number
objects, or
TemplateNumberModel
values. Conversion of numbers into date
values is the same as for java.util.Date
values, ie.
milliseconds since 1 January 1970 GMT.
Formats are specified using the same pattern as the
java.text.SimpleDateFormat
class. As a performance optimization,
some caching of pre-parsed format templates occurs.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "formatDate", freemarker.ext.format.DateFormat.getInstance() ); ...
From your FM-Classic template:
The following creates a directory path: <assign date = 12345678901234> <assign output = formatDate( "dd/MM/yyyy HH:mm", date )> ${output} ...
Method Summary | |
---|---|
TemplateModel |
exec(java.util.List<TemplateModel> arguments)
Executes a method call. |
static DateFormat |
getInstance()
Return a singleton instance of this class. |
boolean |
isEmpty()
Is the object empty? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DateFormat getInstance()
public boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public TemplateModel exec(java.util.List<TemplateModel> arguments) throws TemplateModelException
List
of
TemplateModel
objects.
exec
in interface TemplateMethodModel2
arguments
- a List
of TemplateModel
objects
containing the values of the arguments passed to the method.
TemplateModel
produced by the method, or null
.
TemplateModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |