FROM WHEN ARE ZOMEMIM WITNESSES ON A DOCUMENT DISQUALIFIED?
Gemara
171b (Mishnah): Postdated loan documents are Kesherim.
(Beraisa): If Yo'av and Michah were signed on a document dated 'Nisan 1, in Shemitah (in the place Ploni)', and Reuven and David said 'they were with us that day elsewhere (too far to get to Ploni the same day)', the document and its witnesses are Kesherim. We assume that it was postdated.
The Beraisa is a bigger Chidush. Even though it is unlikely that one would postdate a document and give a date in Shemitah, since it looks suspicious (people usually refrain from lending in Shemitah, lest the loan be cancelled), we assume that this was the case. Shemitah does not cancel loans until the end of Shemitah, therefore the document is valid.
Rabah bar Rav Shila (to scribes): When you write an Akniasa document (in which a Kinyan Chalipin was done), if you know the date of the Kinyan, write it. (The buyer truly has Acharayus from that day.) If not, write the current date, lest it look like Sheker.
Sanhedrin 27a (Abaye): If Shimon testified and was Huzam, all testimony that he gave or will give after his fabricated testimony are invalid;
(Rava): Only testimony he gives after he was Huzam is invalid.
The Halachah follows Abaye against Rava in six places. This is one of them.
Rishonim
Rif (Bava Kama 28b): Some disqualify an Ed Chasimah (a witness who signed a document) who was Huzam from the date on the document. This is wrong. The only way to be Mezim Edei Chasimah is if it is dated (e.g.) Nisan 10 in place Ploni, and others testify that that day they were too far away to reach Ploni that day. If so, we cannot disqualify them from Nisan 10, for perhaps they signed later! Rather, an Ed Zomem is disqualified from when he testified in Beis Din, e.g. he testified on Adar 10 and was not Huzam until Nisan 10. The Yerushalmi supports this. If witnesses know when the document was signed, the Edei Chasimah are disqualified from that day. Alternatively, if witnesses saw the document in the hands of the owner on a certain day, the Edei Chasimah are disqualified from that day, because a signed document is like testimony accepted in Beis Din. They are Resha'im from when they signed, like witnesses who signed on a document with Ribis. This is only if they testified in Beis Din that they signed the document on the date written. If not, a Beraisa teaches that they and the document are Kesherim, for we assume that it was postdated. I wrote this to explain the opinion that disqualifies from when they signed. It is difficult; the Yerushalmi explained only regarding testimony in Beis Din.
Nimukei Yosef (DH Gemara): Even if the document says that it was written on the day it says, if it is a Hakna'ah document (in which the borrower puts a lien on his property from when it is written) one cannot disqualify the witnesses retroactively, for one may write it later and date it from when the Kinyan was made. If today witnesses say that Ploni borrowed three years ago and they were Huzam, surely they are disqualified only from today!
Ra'avan (Sanhedrin Perek Echad Dinei, DH Shtar): R. Chananel says that if, in Nisan (in the year) 798, witnesses affirm their signatures on a document dated Nisan 1, 797, and in Elul 798 they were Huzam, they are disqualified from Nisan 798, not from Nisan 797. Perhaps they signed the day they validated their signatures, and until then they were Kesherim. Why is this Hazamah? Even if they were elsewhere on Nisan 1, 797, perhaps they signed the previous Elul and postdated the document! Since we cannot be Mezim them, there is no Drishah v'Chakirah of the testimony (we are unsure when it really was)! It seems that we say that a document was postdated only when we are forced to, e.g. it is dated on Shabbos or Tishrei 10, or a loan in Shemitah (people do not lend then, lest it be cancelled at the end of the year). We must say that R. Chananel discusses a case when nothing forces us to say that it was postdated. If we would not say so, there could never be Hazamah of testimony in a document.
Note: Perhaps he holds that if Edei Chasimah told Beis Din that they signed on the date written, and were Huzam, only this oral testimony was Huzam.
Toras Chaim (Sanhedrin 32a): Perhaps a postdated document is Kosher only if witnesses say that they saw when it was signed that it was postdated.
Rebuttal (Gra CM 34:13): If there is a Safek about when a document was written, we assume that it was postdated to be Machshir it (Tosfos Sanhedrin 32a DH Chaishinan).
Rambam (Hilchos Edus 19:3): If witnesses said that they wrote a document on the date written, and today other witnesses know the day they signed, or saw the document signed on a certain day, and the Edei Chasimah were Huzam, they are disqualified from when we know that they signed. A signed document is like testimony accepted in Beis Din at the time of the signatures. If there are no witnesses who saw their testimony (i.e. when they signed) or saw the document beforehand, they are disqualified only from when they validated their signatures in Beis Din and said that the document was written on the date. Perhaps this very day they signed it and falsely testified in Beis Din that it was written on the date written, which is years ago.
Rosh (7:6): Abaye says that an Ed Zomem is disqualified from when he testified. E.g., they signed a document dated Nisan 1, and they testified in Beis Din that they wrote and signed the document on the date written, and others testify that that day they were in a different place. They are Resha'im from when they signed. Rava says that they are disqualified only from when they are Huzam, for Edim Zomemim is a Chidush. The Halachah follows Abaye.
Poskim
Shulchan Aruch (CM 34:9): If witnesses said that they wrote a document on the date written, and (today) other witnesses know the day they signed, or saw the document signed on a certain day, and the Edei Chasimah were Huzam, they are disqualified from when we know that they signed.
SMA (22): This is when the witnesses who saw them sign did not see the date and place written in the document. If they saw, they themselves are Mezimim (testify that the Edei Chasimah signed testimony that they did not witness).
Rebuttal (Taz): If they saw them sign the document, why must the Edei Chasimah say when they signed?! We know this without them! Rather, we discuss a document with a Kinyan, which is Kosher even if it was written days after the Kinyan. Therefore, they can be Huzam only if they say that they signed it on the date written.
Shulchan Aruch (ibid.): If there are no witnesses who saw their testimony (i.e. when they signed) or saw the document beforehand, they are disqualified only from when they validated their signatures in Beis Din and said that the document was written on the date. Perhaps this very day they signed it and falsely testified in Beis Din that it was written on the date written, which is years ago.