... code is read into $lCell variable ... $lCell .= ""; # Force read detail into a string format, just in case (as I have seen ... !) use Date::Parse; use Date::Manip; print ("$lCell ...\t"); my @ttt = strptime ($lCell); my $yyy = ParseDate ($lCell,,); #print "ADB $yyy...\n"; if ($yyy ne "") { # Format originally read was in the format 2024-08-09 before converting to string format #code. $lDay = substr($yyy,6,2); $lMonth = substr($yyy,4,2); $lYear = substr($yyy,0,4); } else { # Format was originally 16-08-2024 or similar $lDay = $ttt[5]; # NOTE HERE that the month range in some perl modules has a range 0..1 NOT 1..12, so adjust $lMonth = $ttt[4] +1; $lYear = $ttt[3]; }