Hi @Gery , sorry I was kinda busy today. I already had a idea how to do this, but did not have the time to implement it. I’ve done it now.

Here’s the general idea that I used.

- Get number of full days between the 2 date&time
- Get number of weekend between the 2 date&time
- With the above, I am able to get number of full working days
- Get number of working hours for the start date
- Get number of working hours for the end date
- Add results for #3 and #4 and #5 gives the total working hours.

Of course, I do take care of cases where the 2 date&time are on the same day, etc… where #3 and #4 and #5 are adjusted accordingly.

I wasn’t sure how your input was, I used full date&time values for my demo. I added a few varieties to try to break the workflow, but it looks to work just fine.

This is my input data:

Results:

Your example is on the 1st line, which gives 21 hours.

If you notice the 2nd line, the start date is simply a week before the 1st line with the same end date, therefore you expect 40 more hours (8hrs per day, a week’s of working days is 5 days, that makes 40hrs), and the results is 61 hours, which is expected.

Here’s what the workflow looks like:

You will notice that I have parameterized the workflow where you can easily change the times in the future:

Probably most of these individual calculations could have been done in the same one Column Expressions, but I did it this way so we could visualize the numbers that were being generated.

Similarly, in the Column Expression, you will see 4 expressions. Only the last one is needed, the other 3 are used in the 4th Expression, but I did it this way so we could see the values of these 3 expressions in their own separate columns - they get removed anyways with the Column Filter.

Here’s the workflow: Date and Time difference based on working hours.knwf (32.3 KB)