We are saving our date as
and displaying in a grid as shown below
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
As mentioned by Alok, the now() function will return the current system time. If you set your system time to GMT, you can use the following function to convert to other timezones:
gmt(now(), "America/New_York")
A description of this function is available at https://docs.appian.com/suite/help/17.1/fnc_date_and_time_gmt.html
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