Time Zone code suffix is not displayed in notifications for DateTime fields in email scripts


Even enabling the glide.email.append.timezone system property, the time zone code is not shown in the string that is output in the notification for an email script with a DateTime field.

Steps to Reproduce

1 - Set the system property glide.email.append.timezone value to "true".

2 - Create a new "Test Notification" as follows:


TEST [current.sysapproval.opened_at] = ${current.sysapproval.opened_at}

Set the email script as "Test email script":

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
         template.print('<tr><td>Call Reference:</td><td width="25">&nbsp;</td><td>' + 'current.number' + '</td></tr>');
         template.print('<tr><td>current.sysapproval.opened_at <td width="25">&nbsp;</td><td>' + current.sysapproval.opened_at + '</td></tr>');

})(current, template, email, email_action, event);


3 - Execute and trigger the notification. Notice the  time zone code is not shown for "current.sysapproval.opened_at".


This is expected behaviour by design. When a date is being printed in a mail_script, in order to get the timezone to display, it is necessary to call the getDisplayValue method on the date/time field. For example:


Related Problem: PRB1251778