How to set different timezone with login user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 05:30 AM - edited 12-20-2022 05:58 AM
Hi experts,
I need help from you about timezone.
I want to set time in Work order/ Work order task form.
My timezone (user's timezone) is different with Customer (Account) timezone. I want the time displayed as the customer's timezone.
For example,
my timezone is Asia/Tokyo, the customer's Timezone is Asia/Hong Kong.
I want Set the start Time to 9:00 AM which based on customer's timezone. When I put in the time 9:00 AM in work order/Work order task form, then submit the form.
The time will displayed as 10:00AM for me(time Zone Asia/Tokyou).
How can I implement this?
So far my code is like below, but it just set the time to the timezone of my ServiceNow("Asia/Tokyou"). can you please guide me how to change the timezone?
Thank you.
var startDateTime = new GlideDateTime();
var strsDate = "2022-12-29 9:00:00";
startDateTime.setDisplayValue(strsDate);
startDateTime.setTZ(tz);
var starttimeZoneOffSet = startDateTime.getTZOffset();
starttimeZoneOffSet.setNumericValue(startDateTime.getNumericValue() + starttimeZoneOffSet);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 05:36 AM
Hi,
Have you tried changing Time zone by going to user record?
Thank you
Ruchit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 05:43 AM
Hi Ruchit,
Do you mean, change myself's timezone to the same with Customer as below?
I think we have many customers based on different timezone, we don't want our service desk or our engineer who provide service to customer to frequent change system timezone.
So do you know how to implement the request with code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:08 AM
Hi,
I have implemented this via LDAP integration in past. Basically, my customer was using the time zone field in On-Prem Active Directory. We mapped Time Zone Active directory field in the ServiceNow user table, so there is no manual change of the Time zone in ServiceNow.
Please mark this as correct if this helps you to answer your questions.
Thank you
Ruchit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:10 AM
For your use case, It depends upon how you import accounts in ServiceNow.