aspose file tools*
The moose likes Java in General and the fly likes get the date of next Monday Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "get the date of next Monday" Watch "get the date of next Monday" New topic
Author

get the date of next Monday

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
In Java, is there a way I can get the "date" value of NEXT Monday 9AM ?

For example, if now is Tuesday I want next Monday's 9Am DATE, if now is Monday 9:05AM I still want next Monday's 9AM DATE; if now is 8:55AM MOnday, then it should give me today's 9AM.

I don't see such API. Any help will be appreciated.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

There isn't any API that has that exact method built into it. But you could certainly use java.util.Calendar to do the calculation.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

For most date/time calculations, java.util.Calendar is your friend.


The last two lines show you how to get a Date object or String from the Calendar.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Abdul Aatif
Greenhorn

Joined: Feb 08, 2012
Posts: 23
Thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get the date of next Monday