File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes GregorianCalendar - # of work days Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "GregorianCalendar - # of work days" Watch "GregorianCalendar - # of work days" New topic

GregorianCalendar - # of work days

Ali Ekber
Ranch Hand

Joined: Jun 12, 2005
Posts: 41
Is it possible to calculate the number of work days, say between Apr. 15, 2006 and Jan 20, 2007? I can calulate the number of days, but need Monday-Friday number of days (work days with no holidays)? Thanks.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
What if you identify the closest Sunday to April 15 and the closest Saturday to January 20, and calculate the total number of weeks and from that the total number of days. Then you could subtract 2 days for each week as well as the number of days you added on.
I agree. Here's the link:
subject: GregorianCalendar - # of work days
It's not a secret anymore!