Date + time / hour comparison

Hi, I need to set a conditional logic where I compare an event start datetime (day + hour) with the current time but it doesn’t work with hours, only with day. I tried this :

<Set current_datetime ><Date format="timestamp" timezone="Europe/Paris" /></Set>
  <Set format_mec_start><Date format="timestamp"><Field mec_start_datetime /></Date></Set>

  <If check="{Get format_mec_start}" after_inclusive="{Get current_datetime}">
    true
<Else />
false
</If>```

thank you folks !

Could you give an example of the two values being compared?

Current: <Get current_datetime /><br>
Event Start: <Get format_mec_start />

Since they’re converted to timestamps, the values should be in exact seconds.

Here’s how the If tag attribute after_inclusive should work: with two dates, “inclusive” means compare with the start of the day instead of from the end (as with after attribute). With two date+time values, it should still work correctly to compare two timestamps.

We can also try some values directly, like:

<If check=1 after_inclusive=1> TRUE <Else /> FALSE </If><br>
<If check=1 after=1> TRUE <Else /> FALSE </If>

The first should be TRUE, like 1 >= 1. The second should be FALSE, as 1 > 1. OK, so I confirmed that basic comparison works.

it doesn’t work with hours, only with day

I can’t quite picture this. Could you show some date+time examples how the comparison works with day but not hour?