
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-08-2022 02:39 PM
Converting DateTime field to another time zone-
Use function convertTimeZone();-
*****************
var expectedTimezoneDateTime=new GlideScheduleDateTime().convertTimeZone("CET","GMT");
//You can provide a hardcoded value as well in the function GlideScheduleDateTime("02-02-2022 03:40:67");
var convertedTimeZoneDateTime= new GlideDateTime(expectedTimezoneDateTime);
gs.print(convertedTimeZoneDateTime);
- 7,181 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
But sadly to say, this just returns the date-time in the user display format and not the internal format. We have to make that conversion explicitly.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I'm using the same API as mentioned, it is getting converted when tried on background script but when event triggers and mapped value then it always showing same time that is 01:00:00.
Please advice.
Thanks