- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2025 12:26 AM
There is feild in staging table called created , which is in mutliple formats like GMT , IST etc..
before inserting the data into target table , need to change created on every record to IST
Can someone help how can i approach this one.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2025 09:39 AM
Hi @bandarunave ,
You need to use a Transform Script for this. In the onBefore Script, check the source record’s timezone and then convert it into the required timezone before inserting into the target table.
Thanks,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2025 10:11 AM
Hii @bandarunave ,
If you are moving data from a staging table to target table using a Transform Map, the right place to normalize the created field is in a Transform Script.
If only created field needs conversion → use a field transform script.
If multiple datetime fields → use an onBefore transform script for efficiency.
Giving you a logic I tried on PDI in background script to convert GMT timezone to IST -
var gmtDate = "2025-08-30 12:00:00 GMT"; // Sample GMT timezone
function convertToIST(rawDate) {
var gdt = new GlideDateTime(rawDate); // GMT/UTC parse
gdt.addSeconds(19800); // add 5 hrs 30 mins → IST
return gdt.getDisplayValue();
}
gs.info("GMT Input : " + gmtDate + " | IST Output: " + convertToIST(gmtDate));
Hope it helps!