Hartmann was educated at the "Volksschule" in Weil im Schönbuch (April 1928–April 1932), the Gymnasium in Böblingen (April 1932–April 1936), the National Political Institutes of Education in Rottweil (April 1936–April 1937), and the Gymnasium in Korntal (April 1937–April 1940), from which he received his Abitur.
Tam je bil zajet in je preživel štiri leta v vojnem ujetništvu.