Display Date time field data based on user profile date format & time zone preference in a List Widget.

ashwanikumar
Tera Expert

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

2 REPLIES 2

Shweta KHAJAPUR
Tera Guru

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

I'll try this, thank you.

Will it also covert the time based on time zone?

Thanks,

KUMAR