my $dt = DateTime-> new(year => 2002, month=> 8, ); my dt2 = DateTime->new(year => 2003, month=> 2, ); my $cmp = DateTime->compare($dt, $dt2);