developer documentation r21358

fm:DateFormat

When dealing with dates in your application, the default is usually too long, contains too much information, is ugly looking or just not what you want.
The system default is something like this: YYYY-MM-DD HH:MM:SS

The fm:DateFormat component allows you to (re)format a date returned by the system, in the same way php does.

This component cannot contain children.

Example

<fm:DateFormat date="{$media_upload}" format="d.m.Y" />

Supported attributes

NameRequiredDefaultDescription
dateRequiredN/AThe date to format. This attribute can accept a lot of formats, such as YYYY-MM-DD, 'now', 'tomorrow'
formatRequiredN/AHow to format the date. This attribute accepts a similar format as PHP's date() function

Template variables

This component has no template variables. It only outputs one thing, which is the re-formatted date.

See also

<< 7.3.3 fm:ChannelList 7.3.5 fm:DateList >>