All,
I have been away from VFP development for about 5 years. I'm back working on some things, and something that I thought should be fairly easy/straight forward is becoming really elusive.
What I'm seeking is general guidance here on the best approach to dealing with time calculations. I'm working on a "time recording" system, which will determine when a person works over-time (which is either 8 hours in the same day, or more than 40 hours in a week...) Late night (work done between 2200 and 0500. And then also weekend rate, which is the same as above, but occurring on Sunday. (I can work that part out, but thought I'd give the big picture).
The thing I find is if dealing with time such as 1330 1400 if I just "subtract" these two values, I get 70... because dealing with a partial hour is 60 minutes, not based on 100... pulling the two pieces apart to hours and minutes gets really messy, when there is something like 0945 - 1915 involved...
I'm sure other must have had to deal with manipulating time in the past. The DateTime functions seem totally lacking. It seems to be better to deal with these as character values, and manipulate them with some "time" functions instead. Does anyone have any elegant/creative/interesting ideas on doing this?
Many thanks!
Best Regards,
Scott
"Everything should be made as simple as possible, and no simpler."![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)
I have been away from VFP development for about 5 years. I'm back working on some things, and something that I thought should be fairly easy/straight forward is becoming really elusive.
What I'm seeking is general guidance here on the best approach to dealing with time calculations. I'm working on a "time recording" system, which will determine when a person works over-time (which is either 8 hours in the same day, or more than 40 hours in a week...) Late night (work done between 2200 and 0500. And then also weekend rate, which is the same as above, but occurring on Sunday. (I can work that part out, but thought I'd give the big picture).
The thing I find is if dealing with time such as 1330 1400 if I just "subtract" these two values, I get 70... because dealing with a partial hour is 60 minutes, not based on 100... pulling the two pieces apart to hours and minutes gets really messy, when there is something like 0945 - 1915 involved...
I'm sure other must have had to deal with manipulating time in the past. The DateTime functions seem totally lacking. It seems to be better to deal with these as character values, and manipulate them with some "time" functions instead. Does anyone have any elegant/creative/interesting ideas on doing this?
Many thanks!
Best Regards,
Scott
"Everything should be made as simple as possible, and no simpler."
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)