How to remove weekends from Calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulDigital
    Junior Member
    • Feb 2022
    • 7

    How to remove weekends from Calculation

    Hello everyone,

    I use datetime\diff to calculate the amount of hours that passed between two dates.

    What I need is a way of removing weekends and certain hours so that it calculates the hours passed only in business hours. For example, if the operating hours are from 9 AM to 8 PM and we receive an email at 7 PM, and the agent responds the following day at 10 AM, the formula would calculate a response time of 2 hours (instead of 15 hours like it does now).

    Is this possible? Thanks for any response in advance.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1606

    #2
    Perhaps this heps: https://programmierfrage.com/items/c...uding-weekends

    Comment

    Working...