Skip to main content
madhup0003
September 13, 2023
Question

Convert Time zone

  • September 13, 2023
  • 5 replies
  • 0 views

Hi All,

I have one query related to time zone conversion.

I have start and end date with EDT time zone, and i have to convert this date with given time zone like Mountain, Pacific, Eastern so on.

Can any one help me with same.

Thank you

    5 replies

    mikes0011
    Brainy
    September 13, 2023

    This is often tricky to work with, but what I can suggest up front is to review the available "Date and Time functions" in the documentation.

    sureshd0004
    September 14, 2023

    As Mike suggested it is bit tricky to work with multiple time zone conversion, as Appian when run in process model unless overridden by the PM time zone feature treats date time in GMT else on UI it is based on the  default time zone set on admin console.

    Though it is not a very good way of doing it I found it useful to calculate it like below and save it in DB as the value saved will not contain time zone part hence it saves the date and time value of the provided time zone  (in case of below example 'Asia/Colombo' time).

    gmt(
    local(now(), "Asia/Colombo")
    )

    or you can have an offset filed saved in a database table column of each record (+5 or -1 ) depending on the time zone and and use that to manually calculate the date time values when you need specific value to display or do calculation based on the time.

    mathieud0001
    September 14, 2023

    Should be the opposite no?

    local(gmt(local!dateTime), "Canada/Eastern")

    Stefan has a post that covers this: https://appian.rocks/2023/02/13/working-with-time-in-appian/

    sureshd0004
    September 14, 2023

    It really does not matter much as gmt and local functions counteract each other,

    for example both of below expressions provides the same output,

    {
      
      local(gmt(now()), "Canada/Eastern"),
    
      gmt(local(now(),"Canada/Eastern"))
    
    }