tips icon image

EE Insider Tips
Sponsored by EE Screencasts

ExpressionEngine mini-howtos created by the EE Insider community.

Tips tagged “Comparison”

More precise date comparisons

Posted on June 22, 2009 by Jason Morehead

As with most EE variables, you can do comparisons on date variables, like so:

{if date_variable == "foo"}
    
Do something
{
/if} 

However, if you need more precise date comparisons, you can do something like this:

{if "{date_variable format='%m/%d/%Y'}" == "01/01/2009"}
    
Do something
{
/if} 

Read this tip

Search EE Insider Tips
Sponsored By