How To Compare Two Dates

I want to know how to Compare Two Dates ??
I Mean If I Have Two Dates in Format yyyy-MM-dd
Example :-
2019-04-14 >= 2019-04-15 :point_right: Should Give False;
2019-04-15 <= 2019-04-15 :point_right: Should Give True;
2019-04-16 <= 2019-04-15 :point_right: Should Give False;

I Have Try With Math Compare Blocks Cannot Accept But I Failed
Kindly Suggest Any Way With Blocks

Thanks In Advance;

1 Like

It’s not math, it’s time…
Make sure that the the dates are in the same format. After that, split text (in you case at - and : . ) Then put those numbers to 1-1 list (same posution), select them and compare with maths

1 Like

this interests me too, the same with a time like 12:30. If you want to check if the time is the time like If 12:30= 12:30
To make a reminder.
From 8:00 to 12:00
do set alarm …

I search a while for that but i didnt find something about that.

The same when you get a time and date from a API in a Json format when you se a inter like 12360383747 (this is a example and not a correct JSON answer)
Which time ist that and how can i decode this time format/date format`?

I hope you and i get a answer for this because it is usefule to check dates and times.

It is based on Milliseconds

Use these two blocks . You use Milliseconds as the baseline for your analysis.

Sorry @Robert . Beat you to it :slight_smile:

3 Likes

Which Format It Accept ? Is date Format yyyy-MM-dd ??

It is an easier solution

https://help.appybuilder.com/components/reference/sensors/clock

1 Like

Like someone said, use clock component.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.