- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 01:53 AM
Dear all,
In my email body I am refering a date field as below
update on : {current.sys_updated_on}
By doing so the date time format is not according to user setting.
Is there a way directly in email body to format the field according to user setting ?
regarsd
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 03:03 AM
Hi Wakesprit,
Try this code, it will work. I just checked in my dev instance and its working fine. You need to write this in the email scripts
var tz = gs.getSession().getTimeZone();
var gdt = new GlideDateTime(current.sys_created_on);
gdt.setTZ(tz);
var showConvertedDate = gs.getMessage('Created on: {0}', gdt.getDisplayValue());
template.print('<p>' + showConvertedDate + '</p>');
Mark correct and helpful if this works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 03:03 AM
Hi Wakesprit,
Try this code, it will work. I just checked in my dev instance and its working fine. You need to write this in the email scripts
var tz = gs.getSession().getTimeZone();
var gdt = new GlideDateTime(current.sys_created_on);
gdt.setTZ(tz);
var showConvertedDate = gs.getMessage('Created on: {0}', gdt.getDisplayValue());
template.print('<p>' + showConvertedDate + '</p>');
Mark correct and helpful if this works.