Skip to main content
November 19, 2024
Question

how usertimezone works

  • November 19, 2024
  • 3 replies
  • 0 views

I have a requirement to convert date to text in this format yyyy-MM-dd. 

First i used this function 

datetext(local!date,"yyyy-MM-dd). but it didnt work for all users time zone. so i handled timezone by adding GMT function ie 

datetext(gmt(local!date,usertimezone(loggedinuser()),"yyyy-MM-dd)

This time it worked for all time zone. 

But when i try to execute in the script task in process model, date is coming as -1 day. I also verified override with user time zone setting in PM is already checked. 

Could you someone explain why it is not working. I am attaching snapshot

1. Admin console 

2. my timezone setting 

3. expression rule . I am getting expected result in expression rule  with different time zone.

4. PM timezone setting 

5. result in PM script task when above expression rule is executed.

Anyway, i was able to find out simplest function ie text (local!date,"yyyy-MM-dd).

    3 replies

    stefanhelzle0001
    Brainy
    November 19, 2024

    I wrote a log post about how time in Appian works. Find it here: https://appian.rocks/2023/02/13/working-with-time-in-appian/

    November 19, 2024

    i already read this post. I am trying to convert Date to text . 

    stefanhelzle0001
    Brainy
    November 20, 2024

    In general, the text() function is your friend. Everything else, meaning the time&timezone calculations is automatically done by Appian.