Different Time Zone required in Email Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2015 01:02 AM
Hi,
I have some Date/Time fields in my incident form. Some notifications are triggering on Incident form and that fields are there in the notification body.
System's time zone is in EDT. So in the notification also I am getting the field value as EDT format.
I want it as in UTC format in the Notification only, not in the system.
How to achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2015 01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2015 01:14 AM
I don't want a User Time Zone. It should be UTC for all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 02:32 AM
Hi Tanumoy
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