"This month" [shall be for you]. "He made the moon for appointed times; the sun knows its setting" (Psalms 104:19). Rabbi Yochanan said: Only the orb of the sun was created to give light, for "let there be lights" (Genesis 1:14) is written defectively, as "a curse" [meorot spelled like meerat]. If so, why was the moon created? Only to sanctify by it the beginnings of months and the beginnings of years. Rabbi Shila of Kefar Temarta in the name of Rabbi Yochanan: Even so, "the sun knows its setting" (ibid.) - from here we learn that we do not count by the moon unless the sun has set. Yusta his colleague in the name of Rabbi Berekhya: "And they journeyed from Rameses in the first month, on the fifteenth day" (Numbers 33:3). If you count by the moon, until now there are only fourteen days complete - from here we learn that we do not count by the moon unless the sun has set. Rabbi Zeira in the name of Rabbi Chanina: Only the orb of the sun was created to give light, for "let there be lights" is written defectively. If so, why was the moon created? Because the Holy One, blessed be He, foresaw that the nations of the world were destined to arise and make them into gods, and He said, "If when they are two and contradict one another the nations of the world make them into gods, how much more so if there were only one!" Rabbi Berekhya in the name of Rabbi Simon: Both were created to give light, "let there be lights" (ibid.), "and they shall be for lights" (ibid. 15), "and God set them in the firmament of the heavens" (ibid. 17). "And they shall be for signs and for appointed times" (ibid. 14) - "for signs," these are the Sabbaths, as it is written, "for it is a sign between Me and you" (Exodus 31:13); "and for appointed times," these are the festivals; "and for days" (Genesis ibid.), these are the beginnings of months; "and years" (ibid.), these are the beginnings of years - so that the nations of the world would count by the sun and Israel by the moon. "This month shall be for you the beginning of months" (Exodus 12:2).
Why the Moon Was Created and How Israel Counts Its Months
Pesikta DeRav Kahana 5:1
החדש הזה.[א] עשה ירח למועדים שמש ידע מבואו (תהלים קד:יט). א"ר יוחנן לא נברא להאיר אלא גלגל חמה בלבד, יהי מאורות (בראשית א:יד) מארת כתב. אם כן למה נבראת הלבנה, אלא לקדש בה ראשי חדשים וראשי שנים. ר' שילה דכפר תמרתה בשם ר' יוחנ' אף על פי כן, שמש ידע מבואו (תהלים שם), מיכן שאין מונין ללבנה אלא אם כן שקעה החמה. יוסטה חברה בשם ר' ברכיה ויסעו מרעמסס בחדש הראשון בחמשה עשר יום וג' (במדבר לג:ג), אם ללבנה את מונה עד כדון לית בה אלא ארבעה עשר משוקעין, מיכן שאין מונין ללבנה אלא אם כן שקעה החמה. ר' זעירא בשם ר' חנינה לא נברא להאיר אלא גלגל חמה בלבד, יהי מאורות (בראשית שם), מארת כתב. אם כן למה נבראת לבנה, אלא צפה הקב"ה שאומות העולם עתידין לעמוד ולעשות אותן אלוהות ואמר, אם בשעה שהם שנים והם מכחישין זה את זה אומות העולם עושין אותן אלוהות, אילו היה אחד על אחת כמה וכמה. ר' ברכיה בשם ר' סימון שניהם נבראו להאיר, יהי מאורות (שם), והיו למאורות (שם ט"ו), ויתן אותם אלהים ברקיע השמים וגו' (שם יז). והיו לאתת ולמועדים (שם יד), לאתת, אילו השבתות דכת' כי אות היא ביני וג' (שמות לא:יג). ולמועדים, אילו ימים טובים. ולימים (בראשית שם), אילו ראשי חדשים. ושנים (שם), אילו ראשי שנים, שיהיו אומות העולם מונים לחמה וישר' ללבנה, החדש הזה לכם ראש חדשים וג' (שמות יב:ב).