IF statement based on dates

Is there a way to create an if statement based on today's date? This is what I was trying to use, but it didn't work:

{date=today()}
{if: date <= 2/17/2026}1{elseif: date <= 2/23/2025}2{elseif: date<=3/2/2026}3{endif}

1 Like

Text Blaze's canonical date format is ISO 8601 which is YYYY-MM-DD.

If you enter dates in that format, you can compare them as strings. For example:

{date=today()}
{if: date <= "2026-02-17"}
It's before or on "2026-02-17"
{else}
It's after "2026-02-17"
{endif}

If you have dates in other formats, you can convert them using the datetimeparse() function:

1 Like