in reply to AM/PM in date and time format

use the posix modules strftime() function-

use POSIX; my $date = strftime("%D %H:%M:%S %p", localtime(time));

man strftime for all the strftime formating options.

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell