- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 10:25 AM
Hi All,
Need help/pointer to write script in better way —
Requirement — Custom_table 1 has fields u_date_time and u_timezone on form which stores date/time & timezone value ('America/New_York' )respectively
Question — In scoped application we need to convert time stored in field u_date_time to specific timezone using u_timezone field to display in certain format in script/email template.
u_date_time in GMT - 2017-01-08 21:00:00 //User profile in GMT
u_timezone - America/New_York'
Expected results - 2017-01-08 16 :00:00 EST
Please note that we are not looking timezone based on user session so cannot use gs.getSession().getTimeZone() Also setTZ() and Packages.java.util.TimeZone.getTimeZone('America/New_York'); does not work in scoped app
As a workaround we can create global script include and call from scope
Please share if you have any scoped script which meet requirement
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 11:28 AM
Hi Abhosale,
I think this video can be useful to you.
ServiceNow Live Coding Happy Hour for 2017-02-17 - Time Math with Moment.js - YouTube
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 11:28 AM
Hi Abhosale,
I think this video can be useful to you.
ServiceNow Live Coding Happy Hour for 2017-02-17 - Time Math with Moment.js - YouTube