This isn't a struts question but anyway, assuming you want to do this on the server side and not on the client side (you'd be mad to do it on the client side) the java Date related utility classes will be able to help you out (java.util.Calendar, java.util.GregorialCalendar, java.util.Date).

The way I would do it would be something like this:
1) Create a counter to hold your total
2) Create a date for your start time and for your end time
3) Convert the date for your start time to a Calendar
Write a while loop something like:

while(startDate.before(EndDate)){
  if(startDate is a Sunday){
      ; //do nothing
  }if(startDate is a Saturday){
     total += 0.5;
  }else{
     total += 1.0;
  }
  //add a day to the Start Date
}

HTH, Bart.

Abhimanyu Koul wrote:
hi!
i am really struggling to find a  way to calculate number of days between two 
dates in mm/dd/yyyy which i get using javascript popup calendars.  excluding 
sundays and half saturdays.
the number of days i have to record in the database.
please help

Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Dani Compound,
158, Vidyanagari Marg,
Kalina, Santacruz (East),
Mumbai - 400 098
Mobile : +91 9860582533



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to