Compare two Dates

Good Morning,

I tried several methods to compare two Dates, but I didn´t come to an end.
My request:
Compare two Dates in a rule:
1: Cast from DateTime item to string (worked)
2: Cast from now.plusDays(1) to string (doesn´t work)
-> Compare these two string. (or a better compare method directly with DateTypes?)

This shouldn´t be so complicated……maybe someone can push me to the right direction….
Thanks very much.

if “dateitem” is a DateTime item then convert to a DateTime var by

var DateTime datevar = parse(dateitem.state.toString)

Do all the comparisons with the var e.g.

if (now.compareTo(datevar) >0) …
if (now.plusDays(2).compareTo(datevar) >0) …

Those class definitions are illogical and hard to get.

Got it.
Thanks for your help.