modify time zone in email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2015 12:14 PM
I realize that the time zone in email notifications follows the system time zone. However, is there a way within the email notification or email template to display a field in a different time zone? For example, I have two separate time fields in my email notification that contain Pacific Time zone and an Eastern Time zone. The eastern time zone is automatically converted to pacific time zone. I would like the eastern time zone field to reflect eastern not pacific time zone.
Current:
CA Lab Finished Time: 21:00:00 PST
NJ Lab Finished Time: 01:00:00 PST
Proposed:
CA Lab Finished Time: 21:00:00 PST
NJ Lab Finished Time: 04:00:00 EST

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2015 09:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2015 02:29 AM
Hi Giovanni,
We had a similar problem. We wanted to show specific time zones in our notifications for both our European and US offices. We had 'Proposed start' and 'Proposed End' times that we had to show in GMT, but also the needed to show CST and CET. We achieved this using a simple mail script as follows:
GMT and CET:
var cst_display = 'Undefined';
var bst_display = 'Undefined';
if (current.u_proposed_deploy_start) {
var bst = new GlideDateTime(current.u_proposed_deploy_start);
var b_tz = Packages.java.util.TimeZone.getTimeZone("Europe/London");
bst.setTZ(b_tz);
bst_display = bst.getDisplayValue();
var cet = new GlideDateTime(current.u_proposed_deploy_start);
var c_tz = Packages.java.util.TimeZone.getTimeZone("Europe/Paris");
cet.setTZ(c_tz);
cet_display = cet.getDisplayValue();
}
template.print(cet_display + ' (' + bst_display + ')');
The text when called in the notification shows: '23-12-2015 10:51:01 CET (23-12-2015 09:51:01 GMT)'
GMT and CST:
This was a little trickier, as the date format for the US needs to be split in order to show MM/DD/YYYY - Script as follows:
var cst_display = 'Undefined';
var bst_display = 'Undefined';
if (current.u_proposed_deploy_start) {
var bst = new GlideDateTime(current.u_proposed_deploy_start);
var b_tz = Packages.java.util.TimeZone.getTimeZone("Europe/London");
bst.setTZ(b_tz);
bst_display = bst.getDisplayValue();
var cst = new GlideDateTime(current.u_proposed_deploy_start);
var c_tz = Packages.java.util.TimeZone.getTimeZone("Europe/Paris");
cst.setTZ(c_tz);
var cst_parts = cst.getDisplayValue().split(' ');
var cst_date_parts = cst_parts[0].split('-'); // WARNING - assumes system date format is dd-mm-yyyy
cst_display = cst_date_parts[1] + '/' + cst_date_parts[0] + '/' + cst_date_parts[2] + ' ' + cst_parts[1];
if (cst_parts[2]) {
cst_display += ' ' + cst_parts[2];
}
}
template.print(cst_display + ' (' + bst_display + ')');
The text when called in the notification shows: '12-23-2015 10:51:01 CET (23-12-2015 09:51:01 GMT)'
Hope that's of some help!
Charles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2016 12:26 AM
Thanks a ton charles. You made my day...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2016 01:29 AM
No Problem Arun - hope it helped