Alternate to Packages.java.util.TimeZone.getTimeZone("Australia/Sydney");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 11:28 AM - edited 10-05-2022 11:28 AM
Hi All,
Is it good practice to use Packages.java.util.TimeZone.getTimeZone. If not, could you please let me know the alternatives we can use in ServiceNow scripts to convert timezone.
Thank you
Uttam Sai S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 04:31 PM - edited 10-05-2022 04:32 PM
I've used the following in a mail script before which works perfectly for me.
var convertToCentralStart = global.rmConvertTimeZone(current.getDisplayValue('start_date') + " " + current.getDisplayValue('start_time'),"America/Los_Angeles","US/Central");
The packages option you are asking about is not wrong to use though. I'm just offering an alternative if that does not work in your favor.