I would start by printing out the intermediate results for the hours minutes differences. The interval for the second period is computing as 2 hours and 50/100 of an hour.
I would convert the in and out times to elapsed minutes from the start of the day and then compute the differenece in minutes. And for the display I would convert the minutes into hours and minutes or in decimal hours.
The following sample timesheet performs the calculations using the date and time, converts the intervals into minutes, records the results as minutes, sums the daily times in minutes and uses custom format script to display the time values.
Timesheet Sample
... View more