### Title

Work time calculation

### Post

Hey everybody'

I need a time calculation the can return 30 minute intervals as ".5". I am using FM pro 12 advance and my DB has a "Start Work", "Start Lunch", "End Lunch" & "End Work" fields. example

Start Work 8:00 Start Work 8:00 Start Work 800:00

Start Lunch 12:00 Start Lunch 12:00 Start Lunch

End Lunch 12:30 End Lunch 12:30 End Lunch

End Work 4:30 End Work 4:00 End Work 1430:00

Hours Worked 8.0 Hours Worked 7.5 Hours Worked 6.5

Military times works just as good and maybe better because I want need AM/PM

Thanks for any help

24 hour and 12 hour time formats are stored and calculate the same, but Timestamps would be best. THey will work even when the start time is before midnight and the end time comes after midnight.

The difference between two time fields or two time stamp fields will be measured in seconds. To show the results as hours with a decimal for the fraction of an hour, use this expression:

( TimeStampEnd - TimeStampStart ) / 3600

And if you need to round to the nearest half hour, this basic approach can be modified to show that as well.