Hi we are migrating an application from ASP to Java.In ASP they have used the below function for finding the firstweekday for a given month and year.
for(var i=0; i < 12; i++) {
iPrintDay = 1;
iStopFlag = 0;
iDays=0;
iLastDay = arrMonthDay[i];
datFirstDay = new Date(sParmYear,i, 1);
iFirstWeekday = datFirstDay.getDay();
}
From above for loop, the sysout of datFirstDay will return Wed Jan 1 00:00:00 CST 2014 and the sysout of iFirstWeekday will return 3[which is the starting weekday
for the month of Jan for the year 2014 which they are passing] for the first iteration of the for loop
given above.
I am trying to find the value of iFirstWeekday which is FIRST WEEKDAY STARTING FOR EVERY MONTH for a given year in Java.
I tried lot of solutions but none of them meets my expectation.
Any suggestions will be really helpful to resolve the issue