Conversion

jonnymenthol

Registered User.
Local time
Today, 12:56
Joined
Oct 31, 2001
Messages
58
Hi,

Following on from my query yesterday, I now have a form which contains a start and end time. (in hours, minutes and seconds)

what I want to do now is work out how much this has cost.

For example, if something costs £10 per hour, an 30 minute job would show £5.

I've tried doing a basic calculation, but this doesn't seem to work (probably due to the time spent showing 08:00:00 etc)

therefore I assume I have to convert the time spent to something like seconds. Does anyone know if this is correct. Also, if it is, how would I go about it.

Thanks.

Jonny
 
A time basicaly is a fraction of a day
So 12 hours would be 0,5 day(s)
30 minutes basicaly is 0.0208333333333333333333333 parts of a day..

Taking the time and multiplying it by 24 should be what you want....

12 hours (0,5) * 24 = 12 hours
30 mins(0.020833) * 25 = 0,5

You can then calculate all you want...

Regards

The Mailman
 
Thanks Mailman, that works a treat.
 

Users who are viewing this thread

Back
Top Bottom