Issues with specific timezone only

Certified Associate Developer

Hello All,

 

I have an application where I used datetime component. When user selects any date and time it shows the correct time based on users profile setting but when user sets IST as there timezone then it shows the time which is 30 minutes less. It works fine for all other timezones. Any suggestion about this issue?

  Discussion posts and replies are publicly visible

Parents
  • So I came across this for release notes:

    docs.appian.com/.../Appian_Release_Notes.html

    "Timezone Changes
    With this update, we perfectly matched timezone offsets and daylight savings observance. If you have designed adjustments into your applications to compensate for the previous disparities, those work-arounds may no longer be valid."

    What version of Appian are you using? It looks like some previous versions may have had timezone offset issues in which case you'd have to implement Mitchell's suggested solution. I would put that into it's own expression rule and use it across your application, that way if you upgrade Appian to a version that no longer needs this offset correction you can just update the one expression rule.
Reply
  • So I came across this for release notes:

    docs.appian.com/.../Appian_Release_Notes.html

    "Timezone Changes
    With this update, we perfectly matched timezone offsets and daylight savings observance. If you have designed adjustments into your applications to compensate for the previous disparities, those work-arounds may no longer be valid."

    What version of Appian are you using? It looks like some previous versions may have had timezone offset issues in which case you'd have to implement Mitchell's suggested solution. I would put that into it's own expression rule and use it across your application, that way if you upgrade Appian to a version that no longer needs this offset correction you can just update the one expression rule.
Children
  • 0
    Certified Associate Developer
    in reply to Larry Nguyen
    Hi Larry,

    Thanks for your research and reply. I really appreciate your help. Let me briefly explain about my design first

    1) I'm on appian 18.1
    2) When we use just now() function then code works absolutely fine. It shows the time in proper IST format but we have selected a standard design to store datetime value i.e. YYYY-MM-DDThh:mm:ss(gmt)
    3) Now what I'm doing is during the time of saving selected value into the variable, I'm calling an expression rule and performing below operation to save the value into required format


    load(
    local!isDateNull:or(
    isnull(ri!date_dt),
    len(ri!date_dt)=0
    ),

    local!gmtDateTime:if(local!isDateNull,null,gmt(ri!date_dt)),
    local!year:if(local!isDateNull,null,year(local!gmtDateTime)),
    local!month:if(local!isDateNull,null,month(local!gmtDateTime)),
    local!day:if(local!isDateNull,null,day(local!gmtDateTime)),
    local!hour:if(local!isDateNull,null,hour(totime(local(local!gmtDateTime)))),
    local!min:if(local!isDateNull,null,minute(local!gmtDateTime)),
    local!sec:if(local!isDateNull,null,second(local!gmtDateTime)),

    if(
    and(
    isnull(local!year),
    isnull(local!month),
    isnull(local!day),
    isnull(local!hour),
    isnull(local!min),
    isnull(local!sec)
    ),
    null,
    concat(
    local!year,
    "-",
    if(len(local!month)=1,"0"&local!month,local!month),
    "-",
    if(len(local!day)=1,"0"&local!day,local!day),
    "T",
    if(len(local!hour)=1,"0"&local!hour,local!hour),
    ":",
    if(len(local!min)=1,"0"&local!min,local!min),
    ":",
    if(len(local!sec)=1,"0"&local!sec,local!sec)
    )
    )
    )

    4) So this above mentioned rule is used to convert datetime into specified format and for displaying purpose we are converting the values again into its respective format by using below rule

    =datetime(mid(ri!datestring,1,4),mid(ri!datestring,6,2),mid(ri!datestring,9,2),mid(ri!datestring,12,2),mid(ri!datestring,15,2),mid(ri!datestring,18,2))

    Is there something i'm doing wrong in above code? As I said its happening only for IST timezone and for IST daylight concept is not available i guess.