What is the meaning of the Pasuk "Vayechasu he'Anan Sheishes Yamim? When did it take place?
Rashi #1 (citing Yoma, 4a): The Pasuk means that the Cloud covered Har Sinai for the six days prior to Matan Torah (from Rosh Chodesh Sivan until the sixth), 1 and Hashem called Moshe on the seventh, when He announced the Aseres ha'Dibros. 2
Rashi #2 (Ibid.): The cloud covered Moshe for the first six days after Matan Torah (from the seventh of Sivan until the twelfth), before Hashem called him to come to Him to receive the Luchos.
What was the reason for the six days?
Rashi: We learn from here that whoever enters the Machaneh Shechinah requires separation for six days.
Moshav Zekenim: It was in order to empty all food out of his innards. 1
Moshav Zekenim citing R. Yehudah ha'Chasid: Also the Mishkan was Machaneh Shechinah, and one need not empty his innards before entering it! Here was different, for angels were here, and he had to be like one of them. (R. Akiva said that also angels eat Manna (Yuma 75b)! Gur Aryeh (Bereishis 1:21) says that it is not like our eating. Or, this is like R. Yishmael, who argues with R. Akiva (PF). Or, perhaps Moshe ate from the Shelamim, or the meal with Yisro, if he came before Matan Torah. However, can we say that he defecated while the cloud covered him?!)
Rashi writes that the six days were after Matan Torah. If so, the 40 days [on the Har] finished after the 17th of Tamuz. It says in Ta'anis (28b) that he broke the Luchos on the 17th! Also, 120 days that he was on the Har finished after Yom Kipur! The six days could not be before Matan Torah (like Rashi's other Perush), for he was going up and down!
Moshav Zekenim: Really, they were before Matan Torah. Since Moshe had a path within the cloud (to go up and down - refer to 24:18:1:1), it emptied his innards from food and drink.