1 Chronicles 29:27
And the time that he reigned over Israel was forty years; seven years reigned he in Hebron, and thirty and three years reigned he in Jerusalem. And the time that he reigned over Israel was forty years; seven years reigned he in Hebron, and thirty and three years reigned he in Jerusalem.
David's reign over Israel lasted forty years in total. Seven of those years were passed in Hebron, and thirty-three were passed in Jerusalem. This reckoning belongs to the close of his life, with his final charge to Israel and the transfer of the temple work to Solomon.