Email Notification cannot get the User Time Zone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2014 05:30 AM
Hi,
When we receive the email notifications from service now including work notes in the body, it has shown the instance time zone and time and it does not fetch the users time zone with latest updated time in email.
Can any one please help on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 06:02 AM
Something i found from Wiki. Please look into this it can help how to convert time zones
- 1. //converting GMT to Canada/Eastern
- 2.
- 3. var tz = Packages.java.util.TimeZone.getTimeZone("Canada/Eastern");
- 4. gDate.setTZ(tz);
...right after you initialize the variable and before you assign the date to it. You should end up with:
- 1. var gDate = Packages.com.glide.glideobject.GlideDateTime();
- 2. //converting GMT to Canada/Eastern
- 3.
- 4. var tz = Packages.java.util.TimeZone.getTimeZone("Canada/Eastern");
- 5. gDate.setTZ(tz);
- 6. gDate.setValue(msDate);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 06:10 AM
I think this type of Packages Call is no longer supported in the more recent versions of ServiceNow (I think Calgary and beyond). Can someone confirm this?
I will still try to give this a shot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 06:52 AM
With the packages call, past Calgary you can look up a new GlideScriptable class to do the same thing:
http://wiki.servicenow.com/index.php?title=Packages_Call_Replacement_Script_Objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 02:22 PM
Hi Darryl,
Does it matter where in the email notification that I can put your code in...
<mail_script>
var user = gs.getUser();
var timeZone = String(user.getTZ()); // <---- You can change this line to get the user you wish to use the time zone for or you can use a hard coded time zone.e.g: 'US/Eastern'
TimeUtils.changeTimeZone(current, 'work_start', timeZone);
template.print('First Task Start Date: ' + current.work_start.getDisplayValue());
</mail_script>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 01:39 AM
Hi Giovanni,
Depending on which version you are running it can either go anywhere in the email body html or in the new mail script associated records with a reference in the email body html.