[TYPO3-english] typoscript where clause with date functions?
Jigal van Hemert
jigal.van.hemert at typo3.org
Sun Feb 17 09:17:04 CET 2013
Hi,
On 16-2-2013 23:01, horace grant wrote:
> i am trying to do a query with typoscript and i have to compare dates.
>
> i tried stuff like this:
>
> where = UNIX_TIMESTAMP() < UNIX_TIMESTAMP(day)
>
> but it didn't seem to work. day is a "date" field of my kickstarter
> extension.
If you used the kickstarter to create the date field then it's already
stored as a Unix timestamp (it's an integer field in the database and
the TYPO3 backend displays it as a date).
In that case you can use TypoScript to compare it to the current timestamp:
select {
[...]
where = ###NOW### < day
markers {
NOW.data = date:U
}
}
--
Jigal van Hemert
TYPO3 Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list