CovertTimeZone not converting zones correctly
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 03:19 AM
I am using the script to convert the source timezone (Pacific Time) to local timezone (Europe/Belgrade)
The script works fine, it does calculate, but result is not correct.
var targetTimeZone = 'Europe/Belgrade';
var sourceTimeZone = 'US/Pacific';
var startDateTime = new GlideScheduleDateTime('25-03-2024 05:00:00');
var endDateTime = new GlideScheduleDateTime('25-03-2024 14:00:00');
startDateTime.convertTimeZone(sourceTimeZone, targetTimeZone);
endDateTime.convertTimeZone(sourceTimeZone, targetTimeZone);
gs.print(startDateTime);
gs.print(endDateTime);
This returns 8 hour differential:
*** Script: 2024-03-25 13:00:00
*** Script: 2024-03-25 22:00:00
Which does not seem to be correct since Pacific is currently using PDT (9 hour difference of Belgrade)
Why does this happen and how to fix it?
Thanks!
0 REPLIES 0