Hi Members,I am trying to calculate the working hours between two different time using calworkhours function.It is giving perfect result for all the days except on Fridays. I have check my calendar setting as well . Friday's setting is same as other working days.I have pasted the Screenshot of Calendar and Expression along with it's result.
EscalationCalendar Image : Expression Rule and it's Result Image :
I am expecting 6 hours but it's giving 2 hours and it is same for every Friday.Please help on this ASAP.
Discussion posts and replies are publicly visible
Never noticed this, but turns out calworhours function is a real mess (or may be I'm missing something).
"3" seems like it'd be the valid result, if not for the calendar "end time" set at 5 pm. It makes me wonder whether it's sneaking in any of our normal unintuitive GMT conversion either before or after the results are evaluated?
Hey Mike ,
Can you please have a look at my screenshots at the top.Function is showing not giving results as expected. I have shared the Expression Result's Screenshot and Process Calendar Screenshot as well.For every Friday , it is giving me wrong result.
Smart guess. It seems like the timezone offset is first removed from the inputs and then the hours are calculated. I tried adding timezone offset to the the dateTime and it gave expected result.
Yeah, I was strictly referring to the example Sanchit posted here. For the examples you posted at the top, GMT conversion doesn't even seem like it could be a factor into it (unless your system calendar's timezone is much more offset than I suspected).
Out of curiosity though, what happens if you wrap the initial inputs in "local()" and/or "gmt()" before calling the rule? One of these converts a datetime value TO local time FROM gmt time, and the other does the opposite, and I never reliably remember which one is needed at a given time, but i do know that they ARE needed SOMETIMES.
It's giving wrong result here as well.
We can't see the result. And can you please try to specify the timezone offset in local() function that you are using in Process calendar in case it is different from the context (User's timezone) ?
Here it is buddy , I am getting 7 which is really weird Answer.Process Calendar is set to IST and my local zone is also IST.
Weird. Same thing gives expected output to me with a default calendar, I'm out of ideas.
And the weirdest part is , I am getting wrong results only for FRIDAYs .For the other days, It is working as expected.Is there any other setting which I am missing ?