The ships were obsolete, we know now, but were not considered as such at the time. And, in fact, the P-40 and the B-17s were state of the art at the time. What was really shocking, in retrospect, is how few of the B-17s we had in inventory at the time of Pearl harbor; those destroyed on December 7th, 1941 comprised a significant portion of all of the B-17s we possessed.
Very similar to the number of F-22s we have today.