Display Date time field data based on user profile date format & time zone preference in a List Widget.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2018 06:25 AM
Hi All,
I am working on a custom widget where displaying update field data in a column. When I am pusing the date time field data from the server side code, it always push in the servicenow date format & time zone.
how can i convert date-time data into user profile based timezone & format?
Please let me know if you need more details!
Thanks,
KUMAR
Labels:
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2018 06:31 AM
Hi,
You can use below method in client side to set the date to user format.
getDateFromFormat(start, g_user_date_time_format);
Please refer below link,
https://community.servicenow.com/community?id=community_blog&sys_id=11cdeea9dbd0dbc01dcaf3231f9619a3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 02:19 AM
I'll try this, thank you.
Will it also covert the time based on time zone?
Thanks,
KUMAR