• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

first monday of any month...

 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

TIA...

Vijay
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the Calendar class. Don't hesitate to post more questions.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic