I am trying to convert a date from yymmddto YYYY-MM-DDusing Time :: Piece . When I enter as Nov 31, 2000 (20001131), I get the output as 2000-12-01, which it should not, because it Nov 31does not exist.
use Time::Piece;
my $dt_str = Time::Piece->strptime('20001131', '%Y%m%d')->strftime('%Y-%m-%d');
print $dt_str;
Did I miss something?
source
share