Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Goodday,
I've got an automation that runs fine for the most part but at december first this automation failed.
the failure was triggered by an condition block that checks an app reload time vs date and vs date - 1 day. (see 1ste screenshot)
The output of this block generated a false for the second part of the condition block. I don't understand why.
especially because the day after and the day before it ran oke.
The log show the following (this is the 1ste december run) see screenshot 2:
I would think that this will be set to true.
Note that the block's output gives a true for both 30 november and 2nd december (and after that as well)
see logs (screenshot 3)
what can be the cause of this, how can I fix this? because I assume that this will error on 1st of januari 2024 as well and every 1ste of the month.
Problem is that your dates are in string format and comparison wont work properly on string format.As shown in your 2nd screenshot,it is comparing 30 and 01,which is why it is showing false for 30 < 01.
for this you have to change the format of date before comparing as shown in screenshot below.it will work perfectly.
In Date Output Format use "U" instead of "d-m-Y H:i:s" in all dates you are using.
Problem is that your dates are in string format and comparison wont work properly on string format.As shown in your 2nd screenshot,it is comparing 30 and 01,which is why it is showing false for 30 < 01.
for this you have to change the format of date before comparing as shown in screenshot below.it will work perfectly.
In Date Output Format use "U" instead of "d-m-Y H:i:s" in all dates you are using.
@salmankojar thx, this works. might be a handy thing to know from now on haha.