The Timing of a Meal
Is the status of a meal determined by when the meal begins or when it ends?
In OC 188:10, the Shulchan Aruch writes, “One who was eating as Shabbat concluded should mention Shabbat in the Birkat Hamazon since the determining factor is the start of the meal. This is true for Rosh Chodesh, Purim, and Chanuka, as well.”
This seems to imply that the status of a meal is determined by when it begins.
On the other hand, in OC 271:6, the Shulchan Aruch writes, “One who concluded his meal as Shabbat began…must mention Shabbat in the Birkat Hamazon.”
This seems to imply that the status of a meal is determined by when it ends.
The Rema notes this contradiction in OC 271:6, and rules that the status of a meal is determined by when it begins.
Furthermore, regarding a Purim meal that extends into the night, the Shulchan Aruch writes in OC 695:3, “If one’s [Purim] meal began during the day and continued into the night, one recites “al hanissim” in the Birkat Hamazon since the start of the meal is the determining factor. And some say that one should not recite it.”
This seems to imply that the Shulchan Aruch is truly of the opinion that the start of the meal is the determining factor and that one should indeed recite “al hanissim” in this instance. This is based on the general rule that when the Shulchan Aruch makes one ruling, and then quotes another with the introduction of “And some say,” he is inclined toward the first ruling. Indeed, as mentioned, the Rema rules that we follow the first opinion.
How do we reconcile these contradictions?
Some suggest that the Shulchan Aruch was truly unsure whether the status of a meal is determined by when it begins or when it ends. As such, he essentially rules that one should include every possible insertion into the Birkat Hamazon, since there is ultimately no harm in including an unnecessary insertion (Magen Avraham 271:14).
Normative Ashkenazi practice is to consider the beginning of the meal as the determining factor. As such, one who begins a meal on Rosh Chodesh and concludes the meal after nightfall, should include ya'aleh v’yavo in the Birkat Hamazon (OC 188:10; Mishna Berura 188:34; Shevet Halevi 14:18).
It would be remiss not to mention the major halachic controversy of what to do in the event that one’s seudat shlishit continues into Rosh Chodesh.
According to the Taz (OC 188:7), one should recite both retzei and ya’aleh v’yavo in the Birkat Hamazon. Although this seems to be self-contradictory, as it simply cannot be both Shabbat and Rosh Chodesh, since the latter begins when the former ends, many authorities are not bothered by this (Be’er Moshe 1:5).
According to the Magen Avraham (188:18), if bread is eaten after nightfall, then only ya’aleh v’yavo should be recited.
All authorities agree, however, that one should avoid eating bread after sunset, and certainly after nightfall, in which case one would only include retzei in the Birkat Hamazon (Shulchan Aruch Harav 188:17; Mishna Berura 188:33; Shemirat Shabbat K’hilchata 17 note 35, 57 note 46).
It appears to me that in the event that one’s seudat shlishit continues into Rosh Chodesh, only retzei should be recited since omitting ya’aleh v’yavo on Rosh Chodesh does not invalidate the Birkat Hamazon. So too, one’s intention was to partake of a Shabbat meal, not a Rosh Chodesh one.