The gemara says that a kesuba which is written by day and signed at night is kasher. There are 2 rationales how it can be kasher. 1. Shmuel holds that since a kesubah is a t'nai beis din, the chiyuv goes into effect prior to the signatures being placed on paper. Just as a t'nai beis din, the chiyuv is created by their pesak din, so too by kesubah the chiyuv is created by the chupah even without the document (Rashi, Tosafos Rid is more clear). This rationale would only apply to a case where the chupah preceded the writing of the document, but not with our minhag which is to write the kesubah at the chassan's tish. Also, this leniency is really a machlokes rishonim whether we pasken like rav or shmuel, see Ran. 2. The gemara says that all agree that if the kesubah is written by day and they are osek in the inyan of the chupah without interruption, then even if it is only signed at night, it is valid. Seemingly, this shoud apply nowadays, to consider a kesubah that was written (and signed by day) to be effective even though the chupah took place at night. However, R. Moshe (O.C. 5:9:2) where he explains that the leniency of asukin b'oso inyan only applies to a case where the kiddushin has already taken place, so that the kesubah is technically applicable. But, in our situations where the kiddushin and chupah are both taking place only later, the kesubah must be written, dated, and signed on the day the kiddushin and chuppah take place, and asukin b'oso inyan will not help. Therefore, R. Moshe paskens that if the kiddushin and chupah were delayed until after nighfall, the kesubah must be rewritten.