I’m trying to do check how recent a post is and use that information in a conditional. There is the suggestion that this should be possible in this thread but I cannot get it to work. I’ve tried using just the ee date fields—{entry_date} and {current_time} and also have tried with php, and I can display both the posted time and the current time without a probllem but cannot check the difference between them.
The idea is to only show the posted date for those entries that are less than x hours old (in the example below, 4 hours, or 14400 seconds).
Most recent attempt was this:
{exp:weblog:entries weblog="{master_weblog_name}" category="22" orderby="date" sort="desc" limit="{qntoshow}" entry_id="not {right01}|{right02}|{right03}|{right04}"}
<a class="noline" href="/index.php/igb/listqn#{entry_id}"><h2 class="quicknewstitle2">{title}</h2></a>
<div class="posted3">
Raw Entry Date = {entry_date}<br />
Raw Today's Date = {current_time format="%U"}<br />
{if {current_time} - {entry_date} < "14400" }
Posted at {entry_date format='%h:%i %A'}<br />
{/if}
</div>
{/exp:weblog:entries}
What I get is this:
Raw Entry Date = 1147821780
Raw Today’s Date = 1147880063
but the {if} clause never generates anything, regardless of what I do with the number of seconds, make it > or < or whatever.
Any suggestions would be most welcome.
Thanks.
