The question is, what war is meant? I tend to think it's meaning the war recorded in Revelation 13 for one. There would then be no no way at this point in time for me tell you what year this war is.
Daniel 9:26 And after threescore and two weeks shall Messiah be cut off, but not for himself: and the people of the prince that shall come shall destroy the city and the sanctuary; and the end thereof shall be with a flood, and unto the end of the war desolations are determined.
27 And he shall confirm the covenant with many for one week: and in the midst of the week he shall cause the sacrifice and the oblation to cease, and for the overspreading of abominations he shall make it desolate, even until the consummation, and that determined shall be poured upon the desolate.
Revelation 11:2 But the court which is without the temple leave out, and measure it not; for it is given unto the Gentiles: and the holy city shall they tread under foot forty and two months.
Revelation 12:17 And the dragon was wroth with the woman, and went to make war with the remnant of her seed, which keep the commandments of God, and have the testimony of Jesus Christ.
Revelation 13:5 And there was given unto him a mouth speaking great things and blasphemies; and power was given unto him to continue forty and two months.
Revelation 13:7 And it was given unto him to make war with the saints, and to overcome them: and power was given him over all kindreds, and tongues, and nations.
What I have underlined in Daniel 9:26-27, IMO this is referring to the same events recorded in the book of Revelation via these 4 passages above. IOW, there is no literal city nor literal temple being meant in Daniel 9:26-27 to begin with.