반응형 월말일자1 c# 월말일자 구하기 개발을 하다 보면 월별 일 평균 값을 구하거나 할 때 월말 일자를 구해야 할 일이 생긴다. C#에서는 Datetime.DaysInMonth라는 함수를 재공하고 있어서 쉽게 해당 값을 구해서 쓸 수 있다. 해당 함수의 내부 소스코드는 아래와 같다. public static int DaysInMonth(int year, int month) { if (month 12) throw new ArgumentOutOfRangeException("month", Environment.GetResourceString("ArgumentOutOfRange_Month")); Contract.EndContractBlock(); // IsLeapYear checks the year argument int.. 2021. 9. 27. 이전 1 다음 반응형