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

Lienhart Woitok Lienhart.Woitok at netlogix.de
Mon Jan 12 19:09:21 CET 2015


Hi Jan,

obviously Stephan did more things with DateTime in the recent past than me, I didn't even know the native datetime column was supported by TYPO3. But in your situation I would give the old way of using integer timestamps a try, if they do work your problem is solved for now.

What to do in the future depends. Obviously the native datetime column would be nice if it works, but if it causes you problems, it probably isn't worth the hassle.

Regards,


Lienhart Woitok
Web-Entwickler | netlogix Media

Telefon: +49 (911) 539909 - 0
E-Mail: Lienhart.Woitok at netlogix.de
Web: media.netlogix.de




netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Web: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Jan Kornblum
Gesendet: Montag, 12. Januar 2015 18:36
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] How to compare a DateTime object correctlyinanExtbase query?

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


_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list