How to get current est time

Certified Associate Developer

Hello All,

 

We have a table consisting of 1 field i.e "Addition Date" . Now there are some constraints available on that column according to which AdditionDate>=GETDATE(). The GETDATE() function is taking date and time in the est format. Now as user can have any timezone selected for their profile,Sometimes by using now() function the date that we get doesn't match the above constraints causing DB write failure. Is there a way we can always get current est date and time? No matter what user profile Timezone consists of we need to pass only the current est. Any suggestion here will be appreciated. Thanks in advance

  Discussion posts and replies are publicly visible

Parents
  • Hi viveku0001,
    Hey used now() function to get the current time and date

    and you want that whatever the timezone of user your application should save date and time according to some EST format, so set the Time Zone of appian environment according to your requirement

    OR
    Used following function
    >>>> gmt(now(),"America/New_York")

    In above function just used "now()" function as current date and time and pass second parameter as timezone then you will get the current time and date according to required timezone

    To study gmt() function visit following link

    docs.appian.com/.../fnc_date_and_time_gmt.html
Reply
  • Hi viveku0001,
    Hey used now() function to get the current time and date

    and you want that whatever the timezone of user your application should save date and time according to some EST format, so set the Time Zone of appian environment according to your requirement

    OR
    Used following function
    >>>> gmt(now(),"America/New_York")

    In above function just used "now()" function as current date and time and pass second parameter as timezone then you will get the current time and date according to required timezone

    To study gmt() function visit following link

    docs.appian.com/.../fnc_date_and_time_gmt.html
Children
No Data