Email notification for Change Implentation Showing Incorrect Start/End Times

Peter P
Tera Contributor

Hello everyone!

 

Running into an odd issue with a notification email.

 

During the implementation step of our Change Management process, we have a notification that notifies our users that their change is approved, and to work on their implementation task. This email contains relevant change info (Type, Category, Planned Start/End Dates, etc). However, the CAB date, planned start, and planned end dates are incorrect, and seem to be offset by exactly 5 hours. I've reviewed the email script used to generate the email and see it is using the following for the date variables:

 

>template.print('<b>Planned Start Date</b>' + ': ' + gr.change_request.start_date+'<br/>');
>template.print('<b>Planned End Date</b>' + ': ' + gr.change_request.end_date+'<br/>');
>template.print('<b>CAB Date</b>' + ': ' + gr.change_request.u_cab_date+'<br/><br/>');
 
 
Example Change Date/Time:
PeterP_0-1713548775728.png

 

Email information:

PeterP_1-1713548804639.png

 

I have verified our instance of SN is configured with our time zone. Any thoughts or insight on how to resolve this is appreciated!

1 ACCEPTED SOLUTION

JP - Kyndryl
Kilo Sage

Hi Peter,

Try   

gr.change_request.start_date.getDisplayValue()

instead of

gr.change_request.start_date

 

 

Regards,
JP

View solution in original post

3 REPLIES 3

Dom Gattuso
Mega Sage

@Peter P   You are most likely not getting the Datetime values in local time (for the given user) when constructing the email so it will by default show whatever timezone is defined by the system. When impersonating a user, the times will reflect what the user has defined as their time zone.  

JP - Kyndryl
Kilo Sage

Hi Peter,

Try   

gr.change_request.start_date.getDisplayValue()

instead of

gr.change_request.start_date

 

 

Regards,
JP

Amazing, this solved it! Always foiled by getDisplayValue()!

 

Thanks JP!