how usertimezone works

Certified Lead Developer

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).

  Discussion posts and replies are publicly visible

Parents Reply Children