in reply to counting number of working days
For getting at work days, you will need a list of holidays as well. If you already have Oracle (or any other database), I suggest setting up a table that lists the work-free days (for your business definition of work-free), and then use SQL to get at the number of holidays:
select count(*) from holidays where (day >= ?) and (day < ?)
passing in the start and end date of the range. The number of workdays in the range is then the difference of the number of days and the number of holidays in the range.
Of course, you will also need to insert the weekends into that table, but DateTime or any other simple Perl script looking at the return values from Time::Local should do that for you.
If you want to avoid the DATE type (and for Oracle, depending how much control you have over the database setup, you might want to), be sure to use strings or numbers for the date that compare well, preferably using the format as returned by strftime('%Y%m%d', localtime).
|
|---|