in reply to date problem

The 'hour' parameter (undef) to DateTime::new was an 'undef'

It's telling you that $time[0] is undef.

That would happen if $dtA[3]'s value contained neither ":" nor ".".

Make sure $dtA[3] contains what you think it does.