| Author |
get the date of next Monday
|
ben oliver
Ranch Hand
Joined: Mar 28, 2006
Posts: 369
|
|
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: 16483
|
|
|
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: 19216
|
|
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
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: get the date of next Monday
|
|
|