I'm trying to code more readable dates on posts which have been entered.

It will read "12 - 17 Jan" but if the month is across two months it will read "12 Jan - 2 Feb"

Spitting out my dates like so

<span>{entry_date format="%d %M"} -<br>{expiration_date format="%d %M"}</span>

Shows the dates are not evaluating to the same month... for instance the first entry is "21 JAN - 17 JUL"

If I run a conditional on this exact same entry...

{if {entry_date format="%M"}=={expiration_date format="%M"}}

It's returning "SAME MONTH" am I overlooking something here? does the parse order mess with the conditional (I can't imagine it is in this instance) it may be worth mentioning that if I say "!=" does not equal... nothing is returned.

Any help would be appreciated. Thanks Chris


just around them by '

{if '{entry_date format="%M"}'=='{expiration_date format="%M"}'}


  • You absolute gem, I was using double quotations which kept breaking the statement. This worked a treat, thank you. Mar 14 '14 at 15:10
  • welcome, I am glad to see this help you.
    – Ahmad Saad
    Mar 14 '14 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.