Date comparison issue

Hi, I have a page for rock band shows, where I do a date comparison as a condition. If a date is greater or equal to today I want to display as upcoming, otherwise in the past. By default if nothing is selected the next show appears in main area by default. http://gloom.band/shows.php (still a work in progress). The page works, except for as soon as it reaches the current date the show becomes in the past, I want it to still show all day on the actual day of the show. I am using NOW_UTC to get my current date for comparison, as the server is set to UTC. I have tried doing a comparison using dateadd of -1 so it compares against the day before but this fails Any help appreciated - thank you :slight_smile:
AJ

Hello,
It’s not really clear where you do this check.
Is it on the page? Is it in server connect? If yes - is this a query filter or some condition?

Please provide more detailed information on what you are doing exactly.

Hi Teodor,
I am doing it in the query in server connect, open to any other ways I could do it though. In the first screenshot is how I have it now, which works, however the event date is not working as greater or equal to now, only greater. in the second s my attempted workaround, using a dateadd of -1 so it compares against yesterday, however this produces no result in the page.
Thank you,
AJ

Add two setvalue steps in your server action.
Assign to one of it the event_date value and the now_utc value. Enable OUTPUT for both, and let me know to check your page again.

Thanks, have done that now.

Ok, i see this:

EventDate: "2019-01-10"
TodayDate: "2019-01-10T10:06:28Z"

These dates are in different formats.

2019-01-10 is not greater nor equal to 2019-01-10T10:06:28Z. It is before 2019-01-10T10:06:28Z

2019-01-10 means 2019-01-10 00:00:00 so the NOW is always greater as it is after 00:00:00.

Just apply the same format to your {{NOW_UTC}} expression and your issue will be fixed …

Thank you, working now :slight_smile: