Skip to main content
Known Participant
Jul 18, 2022 2:31 PM UTC
Question

time calculation

Hi Team,

I want to calculate time in hours between two date time like on 

18th 8am to 18th 10am :- 2 hours

18th 12pm to 18th 8pm :- 8 hours 

total :- 10 hours

Can anyone please help calworkhours is not working properly.

    7 replies

    stewart.burchell
    Employee
    Jul 18, 2022 2:52 PM UTC

    Not very helpful but I think calworkhours() is literally calculating a "between" value which means that one of the boundaries (probably the end_datetime) is not being included. An example: between 8am and 10am is actually 1hour and 59 minutes and 59 seconds. I can see that if I do this:

    calworkhours(
      fn!todatetime("18/07/2022 8:00 am"),
      fn!todatetime("18/07/2022 10:01 am"),
    )

    then I get this;

    stefanhelzle0001
    Brainy
    Jul 18, 2022 2:57 PM UTC

    Please explain what "not working properly" actually means.

    Known Participant
    Jul 18, 2022 3:00 PM UTC

    its gives value as 1 if we consider 8 am to 10 am , but I want 2

    stefanhelzle0001
    Brainy
    Jul 18, 2022 3:09 PM UTC