Time Conversion between timezone
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 07:31 AM
I have an requirement basically i need script which will convert 9AM UTC time to equivalent to different time zones.
Lets say user having time zone as "Europe" so need there time when UTC time is 9AM. we have lot of time zones so script should run for all based on user time zone.
Thanks
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 08:08 AM
You can use below script to set TZ as per current logged in user TZ
var session = gs.getSession();
var zoneName = session.getTimeZoneName();
var str = JSON.stringify(zoneName);
var tmpTime = new GlideDateTime();
tmpTime.setTimeZone(str);
gs.print("Date Time as per current user TZ: " + tmpTime.getDisplayValue());
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Best Regards,
Krushna Birla