use strict; use warnings; use DateTime::Format::Strptime; my $parser = DateTime::Format::Strptime->new(pattern => '%d/%m/%Y', on_error => 'croak'); my $dt = $parser->parse_datetime('28/05/2023'); print $dt->subtract(days => 1)->strftime('%d/%m/%Y'), "\n";