Date time of a timezone

We are saving our date as 

  •  now()

and displaying in a grid as shown below 

  • a!gridTextColumn(label: "Added On", field: "createdDtm", data:datetext(index(local!docDataSubset.data,"createdDtm",{}),"MM/dd/yyyy hh:mm:ss")),

 

The user time zone is set to EDT . 

 

Our issue is the system displays some other time 4 hours behind the EDT . 

How can i display a date time of  a specific timezone using date functions 

 

Note : We only have internal  users from east coast , even  we can hard code the eastern time 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Thanks for the response .

    Say I am analyst ,I browse from newyork , i have EDT in my user settings , i save the comment on 9:30 EDT , it is saved as a!save() now() . when this comment is displayed in the grid , the time shown is 5:30 EDT ( It is saved to DB as 5:30 EDT 4 hours less than my current time)
  • Hi Ramanan,

    I can suggest a couple of different approaches to hard code the expression here, although I wouldn't consider these a best practice since they will only work for users in the Eastern time zone (which, as I understand, is your entire user group for this scenario):

    1) You could use the caladdhours() method documented at https://docs.appian.com/suite/help/17.1/fnc_date_and_time_caladdhours.html.  You'll need to make sure you've set your working hours to the entire day all 7 days of the week in the system calendar settings if using this approach.

    2) You could alter the datetime in SAIL with an expression similar to the following:

    if(
    hour(now()) <= 19,
    datetime(year(now()), month(now()), day(now()), (hour(now())+4), minute(now()), second(now())),
    datetime(year(now()), month(now()), (day(now())+1), (4-(24-hour(now()))), minute(now()), second(now()))
    )

     

    Again, these solutions will only work for users in the one time zone you specified, so I'd highly recommend looking into solutions around the system timezone if that is an option.

    Thanks,

    Lucas