A day is divided into 24 equal units of time (hours). Different cultures, however, define the beginning (and end) of a day differently. For instance, while a day on the Gregorian calendar begins at 12 midnight, a day on the Jewish calendar begins at sunset.

“Jewish” midnight varies each day, occurring at the moment that truly is, mathematically, the middle of the night–exactly half the hours between sunset and sunrise. Precise moments like midnight, however, are difficult to define, especially as it changes from day to day based on the position of the sun.

Even the ancient sages questioned the ability of humans to calculate exact midnight (Talmud Berachot 3b), pointing out that even Moses was uncertain and citing Exodus 11:4, when Moses relayed God’s final plans to Pharaoh and stated: “About midnight, I will go out into the midst of Egypt” (Exodus 11:4).

On the other hand, the sages noted that King David stated in Psalm 119:62: “At midnight I will rise to give thanks unto You.” According to Rabbi Simeon the Pious, “A harp was hanging above David’s bed. As soon as midnight arrived, a North wind came and blew upon it and it played of itself. He [King David] arose immediately and studied the Torah till the break of dawn” (Talmud Berachot 3b).

After the destruction of the Holy Temple, a custom arose among the very pious to recite a special midnight service of mourning, Tikkun Chatzot. Rabbi Yisrael Meir Kagan (the Chofetz Chaim, Poland 1838-1933) noted in his Mishnah Berurah that “The Kabbalists have discussed at great length the importance of rising at midnight and how great this is” (Mishnah Berurah 1:3). This custom is not very widespread now, except in certain Sephardi and Chassidic communities.