How to get Last Week of Month from Calendar in JAVA
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
getActualMaximum(Calendar.DAY_OF_MONTH)to get the last day. Set the calendar day (of month) to that value and then get the day of week. Working from that, you can figure out the start of the “last week”, whatever that means to you (last Sunday? last Monday? last complete week?).