I need server script include for how to know the user time zone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 04:28 AM
Hi ,
how to get the time zone of users. if user is Japan or India i need get their time zone please suggest script.
ASAP..
thanks,
venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 04:55 AM
Hi @Anirudh Pathak , thanks for the response.
i would like to know the complete code, how to check if the user is from Japan and if the user is from India after getting the user time zone. please suggest IF condition.
thanks,
venkatesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 05:45 AM
You can glide record to 'sys_user' table and you can get their details based on the time zone.
Please find the sample script below.
var tz = gs.getUser();
var user = new GlideRecord("sys_user");
user.addQuery('time_zone',tz.getTZ());
user.query();
while (user.next()){
gs.info(user.user_name);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 04:49 AM