C#

[C#]마지막 일 구하기 예제

선영아 사랑해 2016. 4. 6. 11:14


DateTime startYMD = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);


//이번달 마지막날
string lYMD = startYMD.AddMonths(1).AddDays(-1).ToString("yyyyMMdd");


또는


int daysInJuly = System.DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);//지정된 월과 연도의 일수를 반환합니다

'C#' 카테고리의 다른 글

[C#/PDA]Datagrid Row Delete  (0) 2016.04.11
[C#/PDA]DataGrid Row Count 구하기 예제  (0) 2016.04.08
[C#]이미지 그리기 예제  (0) 2016.04.05
[C#]이미지 회전 예제  (0) 2016.04.05
[C#]FileSystemWatcher 예제  (0) 2016.04.04