Update DB.php

convertAM function needs work. After that is fixed the sort function should work.