how to know user time zone from script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 02:46 AM
Hi,
I have the date field in my catalog item and auto populate default date something, i have done that, but the issue is, it is showing different because of user based on user time zone.
so, for that i need to write script to validate whether the user time zone is universal if not how to check the user time zone.
example ; i am in universal time zone but my colleague in japan i need to add utc + 9hrs how to write the script please suggest.
thanks
venkatesh t
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 02:29 PM
Hi @t venkatesh1,
Are you trying to set a fixed display value for the date variable across all time zones?
If so, you don't need to write a script to validate the user's timezone.
Instead, try something like this:
javascript: var gdt = new GlideDate(); gdt.setDisplayValue("2021-05-21");gdt.getValue();
Of course, you will need to change the parameter in the setDisplayValue() to fit your needs.
Cheers