Wednesday, October 5, 2011

Extract day of week and days in Month from a particular date

int iMonth = 4;
int iYear = 2011;
int iDay = 1;
DateTime dateValue = new DateTime(iYear, 4, 1);

int iDayOfWeek = ((int)dateValue.DayOfWeek);


//to find out days in month
int iDaysInMonth = System.DateTime.DaysInMonth(2001, iMonth);

No comments:

Post a Comment

How to upload app to macOS

1. Open Terminal Press Cmd (⌘) + Space , type Terminal , and hit Enter . 2. Navigate to Your Build Output Directory Your .app file is likel...