When World War I broke out in 1914, David was a strenuous supporter of the war effort, supporting the campaign for conscription. In August 1915, after reading reports about mining operations and tunnelling during the Gallipoli Campaign, along with Professor Ernest Skeats, a professor at the University of Melbourne, David wrote a proposal to Senator George Pearce, the Australian Defence Minister, suggesting that the government raise a military force to undertake mining and tunnelling. After the proposal was accepted, David used his advocacy and organisational abilities to set up the Australian Mining Corps, and on 25 October 1915 he was appointed as a major, at the age of 57.  The first contingent of the corps consisted of 1,300 officers and men that were initially organised into two battalions before being reorganised into three tunnelling companies, as well as an electrical and mechanical mining company. After departing Australia for the United Kingdom in February 1916, the corps arrived on the Western Front in May 1916. Given the title 'Geological Adviser to the Controllers of Mines in the First, Second and Third Armies', David became relatively independent and spent his time in geological investigations, using his expertise to advise on the construction of dugouts, trenches, and tunnels, the siting of wells for provision of pure drinking water from underground supplies, giving lectures, and producing maps. In September 1916 he fell to the bottom of a well he was examining, breaking two ribs and rupturing his urethra. He was invalided to London but returned to the Front in November, assuming the role of geological technical advisor to the British Expeditionary Force.  On 7 June 1917 his wartime contribution culminated in the mining of German positions in the Battle of Messines. In January 1918, David was awarded the Distinguished Service Order and in November he was promoted to lieutenant colonel. The war having concluded, he was demobilised in 1919. He was also Mentioned in Despatches twice.

Answer this question "Do you know how old he was when this happened?" by extracting the answer from the text above.
25 October 1915 he was appointed as a major, at the age of 57.