Alternate to Packages.java.util.TimeZone.getTimeZone("Australia/Sydney");

Uttam Sai
Tera Contributor

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

1 REPLY 1

Claude DAmico
Kilo Sage

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.

Claude E. D'Amico, III - CSA