Time difference in decimal
Hello All,
I have an application that allows employees to enter a vacation request. If they are taking a partial day, they enter the start time and end time and it is stored in the database as military time (for example: start - 13:00; end - 17:00). I then display the list of vacations on a dashboard application for managers to view.
Occasionally, an employee will enter a time such as 13:30 - 17:00. I want to display this on the screen as 3.5 hours.
My current application used DateDiff to calculate the time difference:
<cfset vacation_hours_taken = (DateDiff("h",qryVacationPDO.time_started, qryVacationPDO.time_ended))>
One, is there a better way to determine the hours difference between the two times, and
Two, is there a way to convert the 3 hours and 30 minutes (3:30) to decimal format (3.5)?
Thanks for any help you can provide.
Regards,
Robert
