I have an entry date as a custom field.
Can I compare my custom filed date to the current date to see if the time has lapsed?
{if {tour1-until format="%D, %d %F"} < {date format="%D, %d %F"}}
even has lapsed
{/if}cheers.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 17, 2011 9:41am
Subscribe [2]#1 / Feb 17, 2011 9:41am
I have an entry date as a custom field.
Can I compare my custom filed date to the current date to see if the time has lapsed?
{if {tour1-until format="%D, %d %F"} < {date format="%D, %d %F"}}
even has lapsed
{/if}cheers.
#2 / Feb 17, 2011 10:07am
Dates are saved as Unix time (http://en.wikipedia.org/wiki/Unix_time) which is in fact just an integer.
So you can simply compare the two variables no need to use the format “modifier”
#3 / Feb 17, 2011 3:46pm
It’s definitely recommended to use a format parameter:
{if "{tour1-until format='%U'}" < "{current_time format='%U'}"}
event has lapsed
{/if}#4 / Feb 19, 2011 7:57am
awesome, worked a treat.
thanks.
#5 / Feb 19, 2011 9:32am
Very glad to hear it. Please post again as needed.