Link to home
Create AccountLog in
Avatar of expertsit
expertsit

asked on

Calendar in Java

In Java , I would like to determine if a 'Monday' is the first or second etc.

How do we do that. We have the Calendar. WeekOfMonth. That will give us only the week number of a day.

thanks in advance
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Use Calendar.DAY_OF_WEEK and Calendar.DATE
These links have some examples on getting the day of the week

http://www.rgagnon.com/javadetails/java-0100.html
http://javaalmanac.com/egs/java.util/GetDaysInMonth.html

Also, the Calendar API has more functions which you can use.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
ASKER CERTIFIED SOLUTION
Avatar of Manikandan Thiagarajan
Manikandan Thiagarajan
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of expertsit
expertsit

ASKER

Thanks to you all.
how is that different from what I and Kelvin_King already suggested?
Ok. When I went back to my question this morning, there were several replies to it. I went through the sites mentioned and found answer to my problem.
I then clicked the 'Accept Answer' to one of them. (I could not accept multiple answers).

That is why I mentioned 'Thanks to you all' in my comments.

thanks for the clarification :)