Change Timezone Of Date/Time Field While Transforming

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2016 12:09 PM
Hello All,
Hope you are doing fine. While performing E bonding Integration between two Service Now instances I encountered with an Time zone issue.
Issue is the other Service Now system runs on CST time zone and uses MM/dd/yyyy hh:mm:ss format where as my system runs on PST Timezone and uses YYYY-DD-MM hh:mm:ss format.
The format can be converted easily while Transforming but the timezone remains CST.
I tried below script and getting Answer gdt.setTZ(tz) as undefined.
var tz = gs.getSession().getTimeZone();
var val = source.start_date;
var gdt = new GlideDateTime(val);
var ntZ= gdt.setTZ(tz);
gs.log(' Answer gdt.setTZ(tz) == ' + ntZ);
Is it I am not utilizing it efficiently? Please assist
Thanks and Regards,
Ayush Saxena

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 06:07 AM
Yes var tz has the expected value, even i am getting correct value in source and gdt it is jut TZ() not working