Note that something like '2019-08-01' looks like a kind of ISO 8601-ish date, and as such will lt le eq ne ge gt cmp stringwise compare properly with other such dates — if they have exactly the same format!
Of course, no date validation is done!c:\@Work\Perl\monks>perl -wMstrict -le "my $d1 = '2019-08-01'; my $d2 = '2019-06-08'; ;; my $comparison = $d1 cmp $d2; $comparison = $comparison > 0 ? 'greater than' : $comparison < 0 ? 'less than' : 'equal to'; ;; printf qq{$d1 is %s $d2}, $comparison; " 2019-08-01 is greater than 2019-06-08
Give a man a fish: <%-{-{-{-<
In reply to Re: Compare two dates
by AnomalousMonk
in thread Compare two dates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |