I am calculating time difference between 2 time stamps in hours: min :sec format .
Now my problem is I have to eliminate weekends between 2 time stamps and calculate difference in hours: min :sec format
Discussion posts and replies are publicly visible
Actually with my code also I am getting the same output but my problem here is to remove weekends
Hello
calworkdays(datetime(2024, 4, 1, 00, 00, 0), datetime(2024, 4, 7, 00, 00, 0))
My problem while is if I have only 3 min difference between 2 dates , but by using this function I am getting 1 day as working day in the case where timestamp is in same date
CalWorkDays calculates days not as elapsed but on an "inclusive" basis, meaning if the start and end times are both "now" then it'll return 1 day, and so on when more days are added. Maybe you should try subtracting 1 from the overall result you're getting and seeing if that lines up with your expected values given different inputs.