Forum Discussion

ahouston's avatar
ahouston
New Contributor II
4 years ago
Solved

Time difference calculation excluding weekends

Does anyone have a pattern available to determine difference between two timestamps and add the duration to another timestamp, both of which calculations would exclude weekends? For example, three ...
  • bojanvelevski's avatar
    4 years ago

    We can add some specific number of days to this calculation, which is basically a failsafe mechanism for picking up working days. Before it was just multiplying the difference, just to be sure, but adding, let’s say 4 days will help the logic to cover this edge cases.

    Or we can complicate the second expression by adding more logic to it, again regarding the exclusion of the non working days.

    I did some unit testing and it seems fine, but you can try more scenarios with both fixes and let me know if we need more updates.

    Dates Difference Updated_2022_02_03.slp (8.1 KB)