[TYPO3-mvc] How to compare a DateTime object correctlyinanExtbase query?

Jan Kornblum jan.kornblum at gmx.de
Mon Jan 12 18:36:06 CET 2015


Hi Lienhart,

>> ... And the database column is "datetime", too.
>
> And that is probably your problem. TYPO3 and Extbase store DateTime as 
> Timestamp in the database (using an integer column). Having a datetime column 
> is not supported (at least by Extbase) as the comparison is made using a 
> timestamp. Try to convert your column to timestamps and it should work.

Thanks for this advice. But i've done several other extensions using 
DateTime both in Extbase and the database and they work fine. But of 
course, there are no comparisons where the timezone could cause a 
problem ;)

So should i really prevent DateTime DB columns in future at all? And, 
when using timestamp/int columns, would the extbase property still be 
\DateTime?

Kind regards, Jan




More information about the TYPO3-project-typo3v4mvc mailing list