Before us is Mishnah 2 of the second chapter of Maseches Gittin, which deals with the matter of the date in a get: the date written in the get, the need to write it, and the rule that a get is valid only if the date recorded in it is correct.
The Gemara gives two reasons for writing the date in a get:
Because of his niece - when a man is married to his sister's daughter, his wife is not only his wife but also a member of his family, and there is room to be concerned that he cares about what happens to her. Therefore, if she commits adultery, he may want to save her from the death penalty. If no date were written in the get, he could write her a get and claim that it had been given to her before the act of adultery, so that she would not be an adulteress at all. Because of this concern the Sages instituted that a date be written in the get.
Because of the produce - the husband consumes the produce of his wife's melog property, the property she brought with her into the marriage which remains in her ownership so that she may take it with her when the marriage ends, while in the meantime the produce is his. Without a date in the get, he might continue consuming the produce even after the divorce, at a time when he has no right to it. For this reason the date is written in the get, and he can no longer consume the produce beyond that date.
The wording of the Mishnah and its rulings:
"Nichtav bayom v'nechtam bayom" - written by day and signed by day: valid even at the outset, and this is the proper way.
"Balaylah v'nechtam balaylah" - written at night and signed at night: this too is valid.
"Balaylah v'nechtam bayom" - written at night and signed by day: valid, since the day follows the night, so the writing and the signing were done on the very same halachic day.
"Bayom v'nechtam balaylah - pasul" - written by day and signed on the following night: it is invalid.
The reason for the invalidity lies in the first reason mentioned, because of his niece: if an act of adultery occurred during the interval between the writing and the signing, the get would appear as though she had been divorced earlier than she actually was.
The view of Rabbi Shimon:
Rabbi Shimon validates the get. The Gemara explains that in his opinion the reason for writing the date in a get is not because of the prohibition of forbidden relations with one's niece, but because of the produce. The concern is that if the get is written with a date earlier than the truth, we will come to take the produce that the husband sold away from the buyers who purchased it, since according to what is written in the bill of divorce the divorce took effect before the sale, and he had no right to sell the produce. It turns out that we would be taking from them unlawfully, claiming that the produce was sold to them in violation of the law.
Nevertheless Rabbi Shimon validates the get, because in his view the husband already forfeits the produce from the moment the get is written: since he has made up his mind to divorce her, he loses the produce at that moment, and he has no right to sell it from the time the get was written, even though the get itself is delivered at a later date.
"Chutz migittei nashim":
The Mishnah continues with the words of Rabbi Shimon: "Shehayah Rabbi Shimon omer: kol hagittin shenichtevu bayom v'nechtemu balaylah - pesulin, chutz migittei nashim" - for Rabbi Shimon would say: all documents that were written by day and signed at night are invalid, except for bills of divorce for women. "All gittin" means all legal documents, not only bills of divorce. They are invalid because they fall into the category of a predated document, a document bearing a date earlier than the time the loan was actually made.
The explanation is as follows: if a man lends money to another, and afterwards the borrower sells property that was mortgaged to the loan, the lender collects from the buyers who purchased that property - provided that the sale truly took place after the loan. But if the loan document records a date earlier than the truth, it turns out that we are collecting from the buyers unlawfully, since according to the document the loan preceded the sale, whereas in reality this was not the case.
Therefore Rabbi Shimon rules that all documents written by day and bearing the date of that day, while their signing and delivery took place on the following night, are invalid - except for bills of divorce for women. For in a get, as stated according to his view, from the moment it is written the husband is no longer entitled to the produce, so the produce turns out to have been sold unlawfully, and it can be collected from the buyers to whom it was sold.
In summary: in this Mishnah we learned the law of the date in a get: two reasons for writing it - because of his niece and because of the produce; three valid cases (day and day, night and night, night and day), and one invalid case - written by day and signed at night. Rabbi Shimon validates a woman's get, in accordance with his view that the reason is because of the produce and that the husband already forfeits it from the time of the writing, while he leaves the invalidity in place for all other documents on the grounds of a predated document.