With DateTime (DateTime::Format::Strptime):
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";
Hope this helps!
In reply to Re: Yesterday's date
by 1nickt
in thread Yesterday's date
by jpys
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |