[TYPO3-mvc] format.date not converting from timestamp?

Thomas Allmer at at delusionworld.com
Sat Mar 12 00:14:59 CET 2011


how about...

{f:format.date(date: '@{filter.filterValueTo}', format: 'd.m.Y')}

On 11.03.2011 21:32, Simon Schaufelberger wrote:
> Hi,
> What is the corresponding inline notation for that?
> i am struggeling with it but i don't get it working.
> i tried:
>
> {@{filter.filterValueTo} -> f:format.date(format: 'd.m.Y')}
> {@filter.filterValueTo -> f:format.date(format: 'd.m.Y')}
> {f:format.date(date: @{filter.filterValueTo, format: 'd.m.Y'})}
> {f:format.date(date: @filter.filterValueTo, format: 'd.m.Y')}
>
> Am 19.11.2010 18:18, schrieb Bastian Waidelich:
>> Sy Moen wrote:
>>
>>> I have typo3 4.5alpha 3 installed... and the ViewHelper for format.date
>>> (DateViewHelper.php) throws the, "could not be parsed by DateTime
>>> constructor." error because the $date is a timestamp... which is how it
>>> is stored in the db...
>>
>> Hi Sy ;)
>>
>> Apart from passing a DateTime object you can use all formats from
>> http://de3.php.net/manual/de/datetime.formats.php
>> Unix timestamps have to be prepended with "@"
>>
>> try:
>> <f:format.date format="Y-m-d">@{yourTimestamp}</f:format.date>
>>
>> HTH
>> Bastian
>


-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-project-typo3v4mvc mailing list