{dateObject}
{dateObject}
+1 week 2 days 4 hours 2 seconds
@{someTimestamp}
{f:format.date(date: dateObject)}
{dateObject -> f:format.date()}
{dateObject -> f:format.date(localeFormatType: 'date', forceLocale: true)}
{dateObject -> f:format.date(forceLocale: 'de_DE')}
显示文件
Open project: neos/flow-development-collection
Class Usage Examples
Property | Type | Description | |
---|---|---|---|
$datetimeFormatter | |||
$escapeChildren | boolean |
Method | Description | |
---|---|---|
render ( mixed $date = null, string $format = 'Y-m-d', string $localeFormatType = null, string $localeFormatLength = null, string $cldrFormat = null ) : string | Render the supplied DateTime object as a formatted date. |
public render ( mixed $date = null, string $format = 'Y-m-d', string $localeFormatType = null, string $localeFormatLength = null, string $cldrFormat = null ) : string | ||
$date | mixed | either a \DateTime object or a string that is accepted by \DateTime constructor |
$format | string | Format String which is taken to format the Date/Time if none of the locale options are set. |
$localeFormatType | string | Whether to format (according to locale set in $forceLocale) date, time or datetime. Must be one of Neos\Flow\I18n\Cldr\Reader\DatesReader::FORMAT_TYPE_*'s constants. |
$localeFormatLength | string | Format length if locale set in $forceLocale. Must be one of Neos\Flow\I18n\Cldr\Reader\DatesReader::FORMAT_LENGTH_*'s constants. |
$cldrFormat | string | Format string in CLDR format (see http://cldr.unicode.org/translation/date-time) |
return | string | Formatted date |
protected DatetimeFormatter,Neos\Flow\I18n\Formatter $datetimeFormatter | ||
return |