Say your looking for next tuesday:

int desiredDay = 2; // tuesday
Date currDate = new Date();
int currDay = currDate.getDay();
int daysToJump = (7+desiredDay-currDay)%7
if (daysToJump == 0) daysToJump = 7;
Date nextTuesday = new Date(currDate.getTime() + daysToJump * 24 * 60
* 60 * 1000);

No testing, and off the top of my mind. This will have issues with DSL
and all, but should be good in most cases.

   Philippe



On Nov 17, 7:25 am, "anthony.more...@stambia.com"
<anthony.more...@stambia.com> wrote:
> Thank you for your quick answers.
> However, I dont know many days i must add to get to the next "day of
> week". Or should I make a huge and ugly if statement on the current
> day?
>
> For example, today we are wednesday, when is the next tuesday?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to