Pardon my if this question has already been answered, but I've search the forum and didn't find any results that fit my needs. If it has, please point me in the right direction.
I'm trying to build a timecard DB. Users would enter in the time they came and went and the script would calculate the total hours.
I'm using calculations for other items, but I can't seem to figure out how to calculate time. By using 24hr time, and using in db.cgi, it will calculate, but only in full hours:
If I come in at 0800 and leave at 1200, it calculates 400, but if it's 0815 and 1200, I get 385, which isn't accurate.
This also gets a bit complicated since I need 2 in and out times each day for 2 weeks.
I thought of having separate records for each day, but I don't know how to pull the 2 weeks I need for each pay period.
If anyone has suggestions on this, it would be greatly appreciated.
I'm trying to build a timecard DB. Users would enter in the time they came and went and the script would calculate the total hours.
I'm using calculations for other items, but I can't seem to figure out how to calculate time. By using 24hr time, and using in db.cgi, it will calculate, but only in full hours:
Code:
$in{'Date1Reg'} = $in{'Date1Out1'} - $in{'Date1In1'};If I come in at 0800 and leave at 1200, it calculates 400, but if it's 0815 and 1200, I get 385, which isn't accurate.
This also gets a bit complicated since I need 2 in and out times each day for 2 weeks.
I thought of having separate records for each day, but I don't know how to pull the 2 weeks I need for each pay period.
If anyone has suggestions on this, it would be greatly appreciated.

