That is not the original question however. IIRC, you wanted pay periods.
Now it seems you may want the number of days worked so you can pay them for
days worked. I am confused.
Pay periods in the form of a double, with precision to two decimal
places. I don't know if this is the norm or not, but the way our system
works is that you have a net salary for a pay period, but the 2nd pay
period for a given month has a variable length, determined by the length
of that month. So working between the 20th and the 25th in February
will apparently yield a larger net pay than the same days in January.
Of course, nobody in our system only works for such a small amount of
time. However, there are plenty of cases where people are paid from two
or three different sources of funding in the budget, and those sources
can switch from one to another on any given day. The employee is paid
the same, but the budgets and finance department needs to track the
sources of funding per employee with more precision.
The more I looked into it today, I found that the most useful functions
will be the one that determines the number of days in a given month and
the one that determines whether or not a given year is a leap year.
Other than that, it'll likely be a bunch of conditionals and whatnot,
piecing together the end result.
Not as simple as subtracting the DateTime values and applying some
built-in method, but it won't be too difficult I guess. If I have to, I
can hard-code an array of the 24 given pay periods for a year, making
the proper exceptions for leap years of course.
In any event, I appreciate the feedback from the group. As it turns
out, Kevin Spencer's original points were on target. A couple emails
today showed me that the budgets and finance people don't have all their
business logic together. And they need to do that before I can do any
more coding.
(Of course, if the logic at the beginning of this post holds true, then
I'm going to be sure to plan any future unpaid time off accordingly.
The latter half of any 31-day month, whichever 31-day month has the
fewest weekend days between the days of 16 and 31 ideally, will yield
the least lost pay.)
Regards,
David P. Donahue
(e-mail address removed)