This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to find monday in a selected date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to find monday in a selected date" Watch "how to find monday in a selected date" New topic
Author

how to find monday in a selected date

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
when i select a date, i need to find sunday and monday for that particular week . can you give idea for this.
If you dont understand means, just consider am selecting a date. Then i have get start date and end date of a week

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4425
    
    8

Well, it seems the first step is to get the day of the week for the date you're interested in. The Calendar class can do that - look at the get method and the DAY_OF_WEEK constant in the Javadocs.

Once you've got that, you can roll the date forward/back the right number of days. The Calendar.add method will do that for you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to find monday in a selected date