We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Convert any Timezone to IST

Venkat139
Tera Contributor

we have a script where we are converting any timezone to IST . Which is working fine when we run using background- script but does not work when using script include.

Below is the script reference

 

Converttimezone: function(updated) {
var session = gs.getSession();
var zoneName = session.getTimeZoneName();
var expectedTimezoneDateTime = new GlideScheduleDateTime(updated).convertTimeZone(zoneName, "IST");
var convertedTimeZoneDateTime = new GlideDateTime(expectedTimezoneDateTime);
return convertedTimeZoneDateTime;
},

 

Thanks&Regards

VenkatReddy M

2 REPLIES 2

Vinayak Belgaon
Mega Guru

The current session time zone may differ from the time of the parameter "updated" hence there may be some difference.

 

Regards

Vinayak

sorry vinayak I didn't get you can you explain it briefly