calcWeekdays()

Calculate the number of weekdays between this date and another date.

Syntax

public int calcWeekdays(DtpDate date)
 

Parameters

date
The date to compare with this date.

Return values

An int representing the number of weekdays. This is always a positive number.

Exceptions

DtpDateException
 

Notes

The calcWeekdays() method calculates the number of weekdays between this date and another date. The difference between Friday and Saturday is 0, and between Friday and Monday is 1. Weekdays are assumed to be Monday through Friday or the equivalent values. A weekday is not the same as a business day, since a holiday can fall on a weekday.

Examples

try
    {
    DtpDate toDay = new DtpDate();
    DtpDate tomorrow = toDay.addDays(1);
    int days = today.caldWeekdays(tomorrow);
    }
 catch ( DtpDateException date_e )
    {
    System.out.println(date_e.getMessage());
    }
 

See also

calcDays()

Copyright IBM Corp. 2003