Skip to main content
February 14, 2024
Question

calisworktime() not working properly

  • February 14, 2024
  • 5 replies
  • 0 views

I have defined a process calendar called "US calendar".

I defined working hours for 14.2.2024 to be from 8am to 4pm.

When calling calisworktime(datetime(2024,2,14,15), "US calendar") (checking if 4pm is working time) it returns true.

Then i set working hours for 14.2.2024 to be from 8am to 5pm.

Then i called calisworktime(datetime(2024,2,14,16), "US calendar") (checking if 5pm is working time) and it returned false.

It appears that calisworktime() function does not behave consistently. I have tried searching for this problem but it appears nobody else has experienced it.

5 replies

mathieud0001
February 15, 2024

- What timezone is the calendar in?

- What timezone are you in?

prakhars0731
February 15, 2024

Hi [mention:9e66e3200e3446dcb5ba15acedbd21e0:e9ed411860ed4f2ba0265705b8793d05]  I think whatt I have noticed with these function is that if our env is of diffferent timezone than these function does not act according to env . In that case we have to give conditions in such a way that it works according to our env timezone.

stefanhelzle0001
February 15, 2024

Working with time can become very confusing. I wrote a blog post about how Appian deals with time.

https://appian.rocks/2023/02/13/working-with-time-in-appian/

February 15, 2024

[mention:f5e81b8502fa4e77ad12697686a4fc56:e9ed411860ed4f2ba0265705b8793d05]  [mention:1e4ed5f1032942938aff6ef844c18cbb:e9ed411860ed4f2ba0265705b8793d05] 
Timezones are the same UTC + 01:00.

[mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] 
The article is great, but it doesn't help with this specific problem. I think this is just a bug in Appian.

mathieud0001
February 15, 2024

Try using userdatetime instead of the regular datetime function.