I applied the method to get the Monday date of the current week, and I set Monday as the first day of the week.
But, no matter what I do, he returns Sun Mar 24 15:03:07 GMT 2013. I do not see that the problem is here. Can anybody help?
public static Date getFirstDayOfWeekDate() { Calendar cal = Calendar.getInstance(); cal.setFirstDayOfWeek(2); cal.set(Calendar.DAY_OF_WEEK, cal.getActualMinimum(Calendar.DAY_OF_WEEK)); Date firstDayOfTheWeek = cal.getTime(); return firstDayOfTheWeek; }
java date calendar
user1899174
source share