I am using PHP to query an AS400 DB2 database. The time(ADACTM) is saved in the table like;
I need to convert this to a human-readable format like 9:46:23.
I am currently doing this in PHP;
$adactm = str_split($fin2['ADACTM']);
$adactm = "$adactm[0]$adactm[1]:$adactm[2]$adactm[3]:$adactm[4]$adactm[5]";
The problem is, when the time doesn't have a 2-digit hour, PHP thinks array position 0 is actually position 1. So the time shows like;
94:62:3
If anyone has a way to fix this, it would be greatly appreciated. Thanks!