How to get current date time in user logged in time zone - client scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2022 10:51 PM
Hello,
I am using var nowTime = new Date().getTime(); to get the current date time, but this is not returning in logged is user timezone.
Can anyone please let me know how to get urrent date time in user logged in time zone in client scripts
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2022 10:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2022 11:13 PM
I need to get the current date time in user specified timezone which was selected in user profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2022 11:22 PM
Hi
var nowTimeis=new GlideDateTime().toString();
var timeis=nowTimeis.split(' ')[1];
gs.print(timeis);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2022 11:26 PM
Hi,
this would give you in server side
var gdt = new GlideDateTime();
gs.info(gdt.getDisplayValue());
Regards
Ankur