📅  最后修改于: 2022-03-11 14:48:47.136000             🧑  作者: Mango
public static IEnumerable AllDatesInMonth(int year, int month)
{
int days = DateTime.DaysInMonth(year, month);
for (int day = 1; day <= days; day++)
{
yield return new DateTime(year, month, day);
}
}