Page 1 of 1
time registration system
Posted: Wed Jan 23, 2013 9:12 am
by headbull
Hi everyone,
Im looking for any good ideas to solve a time/hour registration script. It uses MySQL and PHP (offcourse

)
What shall i Work with ? Timestamps, date and time by it self ? Whats the best way of calculating hours spent (1hr30m or 1,5 hr .... ) ?
Anyone got a good idea ?
Re: time registration system
Posted: Wed Jan 23, 2013 10:24 am
by twinedev
What will you tracking? How precise do you need the tracking (to the second, to the minute, etc)?
Re: time registration system
Posted: Thu Jan 24, 2013 3:06 am
by headbull
30 minutes/0,5 hrs
Its going to be used for invoicing. I have done most of the system, but when it comes to this time registration module, I dont know where to start and how to work with the time...
Re: time registration system
Posted: Thu Jan 24, 2013 10:48 am
by Christopher
Timestamps, dates and times are all to store data/time values. You are working with durations. I would suggest using minutes rather than hours because you will not get the calculation errors with integers that you might get with floats. Timestamps are in seconds and very easy to do calculations with, so if you want to add/subtract your durations from times then timestamps would make it easy. But keeping durations in seconds is not very readable as data if that's important -- minutes might be better and just multiply times 60 to work with timestamps.