This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes first monday of any month... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "first monday of any month..." Watch "first monday of any month..." New topic

first monday of any month...

Vijay Vaddem
Ranch Hand

Joined: Feb 13, 2004
Posts: 243

Can anyone tell me about how to find the date of 1st Monday of a month..


Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Take a look at the Calendar class. Don't hesitate to post more questions.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Set the calendar to the first of the month
determine the DAY_OF_WEEK
use add() to deduct DAY_OF_WEEK, and add 2
if DAY_OF_WEEK > 2 add another 7
It is sorta covered in the JavaRanch Style Guide.
subject: first monday of any month...
It's not a secret anymore!