Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

timezone package call in scoped application

abhosale
Tera Contributor

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

1 ACCEPTED SOLUTION
1 REPLY 1

AndresGT1
Tera Expert