Joseph Smith made this statement at the conclusion of a speech in the public square at Far West, Missouri on October 14, 1838. This particular quote is documented in Fawn M. Brodie, No Man Knows My History, second edition, (New York: Alfred A. Knopf, 1971), p. 230–231. Fawn Brodie’s footnote regarding this speech contains valuable information, and follows. “Except where noted, all the details of this chapter [16] are taken from the History of the [Mormon] Church. This speech, however, was not recorded there, and the report given here is based upon the accounts of seven men. See the affidavits of T.B. Marsh, Orson Hyde, George M. Hinkle, John Corrill, W.W. Phelps, Samson Avard, and Reed Peck in Correspondence, Orders, etc., pp. 57–9, 97–129. The Marsh and Hyde account, which was made on October 24, is particularly important. Part of it was reproduced in History of the [Mormon] Church, Vol. III, p. 167. See also the Peck manuscript, p. 80. Joseph himself barely mentioned the speech in his history; see Vol. III, p. 162.”
Pretty much like a hadith then eh. Ironic.