Hi All,
I basically created a custom between date for my users. The purpose of it is basically to mimic the start date of a month to the end date of the month for my data. Shown below is basically what it does:
My question here is this. From my understanding, Appian's database stores any datetimes column as UTC, before converting it back to whatever timezone the user is from during the interface display. However, what exactly should I set as my between date during the process of filtering? I'm unsure of how exactly the query filter will communicate with my cloud database (my record type) to retrieve data. My worry is that the values are inaccurate and data is wrongly displayed and calculated due to the some edge cases, e.g. on the last day of the month.
Here is my code for the between:
As you can see from the "Chosen From Date" and "Chosen To Date", I initially attempted to custom fit it to my timezone. During this process, I returned the value created as a way to double-check that the filtered data from-to is correct. However, I also had to do some workarounds as it didn't seem correct to me.
Here is my code to get the 1st day of the month and last day of the month:
Hoping to seek help from others on how I can handle the Timezones.
Just a note: all my users are in the same timezone, UTC +8. Hopefully this will simplify the logic more.
Thanks in advance.
Discussion posts and replies are publicly visible
Use userdatetime() to create the datetime in user context and then convert it to UTC for filteringI would recommend go through this once - https://community.appian.com/success/w/guide/3276/handling-date-and-time