UNDERSTANDING SCRIPT

How do I make this script

:global currentdate
{
:local newdate "06-05-2022"
:if ($newdate => $currentdate) do= {:put "the new date is minor"} else={:put "the new date is major"}
:delay 2
set currentdate $newdate
}

write if the new date is minor than the current date “the new date is minor” and if the new date is major write “the new date is major”. Thank you.

EL DONCITO.

You can not compare strings on RouterOS if are more, or if are less, or if are equal or less, (or if are equal or major).
You can check only if are equal or not equal (different)
But for some reason => do not give an error but have exactly the same function as “=”

You need to compare the dates when both are converted to Unix Epoch,
or write a multiple nested function than first compare year, then month, then day.

On your case, first check if are equal, then on another :if ckec if are major or equal…