in reply to Formatting date while parsing CSV

The starting point would be to dump $fields[38] and $fields[39] to verify they hold what you expect.

You should also create a short test script that just tests/troubleshoots this problem. For example:

use strict; use warnings FATAL => 'all'; use Time::Piece; use Data::Dumper; my $in_date = '01/02/2003 01:02:03'; my $t = Time::Piece->strptime($in_date, '%m/%d/%Y %H:%M:%S')->strftime +('%Y-%m-%d %H:%M'); print Dumper $t;