TYPO3 v14 Backend Access, User Roles & Permissions: Complete Admin Guide (2026)
Security
Are you looking for "X times ago" display for TYPO3 Fluid's date format? In this TYPO3 tutorial, Learn how to achieve it. We can configure any Date Format by <f:format.date> view helper, but it's a bit difficult to get the in the format of "Times Ago" with reference to the current time.
<f:section name="timeAgo">
<f:variable name="now" value="{f:format.date(date: 'now',format:'%s')}" />
<f:variable name="posted" value="{f:format.date(date:'{posted}',format:'%s')}" />
<f:variable name="diff" value="{now - posted}" />
<f:if condition="{diff} < 60">
<f:then>Now</f:then>
<f:else if="{diff} < 3600">
<f:format.number decimals="0">{diff / 60}</f:format.number> minute ago
</f:else>
<f:else if="{diff} < 86400">
<f:format.number decimals="0">{diff / 3600}</f:format.number> hours ago
</f:else>
<f:else if="{diff} < 604800">
<f:format.number decimals="0">{diff / 86400}</f:format.number> days ago
</f:else>
<f:else if="{diff} < 2419200">
<f:format.number decimals="0">{diff / 604800}</f:format.number> weeks ago
</f:else>
<f:else if="{diff} < 29030400">
<f:format.number decimals="0">{diff / 2419200}</f:format.number> months ago
</f:else>
<f:else>{f:format.date(date: '{posted}',format:'%d %B, %Y')}</f:else>
</f:if>
</f:section>
<f:render section="timeAgo" arguments="{posted:'{posting.datePosted}'}" />
Sonal Chauhan
TYPO3 Developer at NITSAN and T3Planet, Love TYPO3 :)
More From Author