When to write the Kesuba:
It is best for both the Kesuba and Chuppah to take place by day, before sunset, in order to avoid all Halachic issues involved in the validity of the date of the Kesuba, and so is the custom in Yerushalayim. Below we will discuss if the Kesuba may be written by day and have the Chuppah take place at night, and whether both the Kesuba and Chuppah may take place at night, and the Halachic issues involved in doing so.
What is the law if a Kesuba was written and signed during the day, before sunset, but the Chuppah took place at night? If the Kesuba was written and signed during the day, and the Kinyan with the Chasan likewise took place during the day, then the Kesuba is valid even if the Chuppah only took place at night, or several days later. Furthermore, one may even initially do so, and so is the Chabad custom. However, some Poskim rule that if the Kesuba was written by day and the Chuppah took place at night then the Kesuba is invalid and a new Kesuba must be written.
May the Kesuba be written by night, before the wedding? It is best not to write the Kesuba at night being it only takes effect at the end of that day [towards sunset], as there are no hours written in the Kesuba, and hence it ends up that the couple was the first night without a Kesuba.
 See Beis Shmuel 66:7; Gittin 18a; Kochav Meyaakov 196; Kaneh Bosem 2:1; Nitei Gavriel 30:10; Rebbe in Toras Menachem 10:199 [printed in Shulchan Menachem 6:44]; Many Poskim brought in footnote 2 in Shulchan Menachem ibid
 Rebbe ibid
 Igros Moshe Even Haezer 4:105; Divros Mosh 290 footnote 54
 The reason: As the Kiddushin must take place in order for there to be a Shibud, legal binding, of the Kesuba, and since the Kedushin only took place at night it ends up the Kesuba was not legally bound until nighttime. Now, being that the date of the Kesuba states the date of the previous day, it is invalid due to it being a “Shtar Mukdam”, a predated document, which is invalid due to its potential legal ramifications towards liens. [ibid]
 See Shulchan Menachem ibid footnote 2 in name of Ezer Mikodesh 62 and Rivivos Efraim