Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change the format of published and last modifed field in KB Portal

Sweta10122
Tera Contributor

Hi All,

I have a requirement where I need to show the last modified date and time and the published date of an article in knowledge portal in format YYYY-MM-DD HH:MM:SS. I have enabled the system properties "glide.knowman.search.show_last_modified" and "glide.knowman.search.show_published", but the way its getting displayed in portal is "1day ago" or "3 weeks ago" etc. How to change this format to YYYY-MM-DD?

Can anyone suggest me how to proceed?

Sweta10122_0-1699609523686.png

 

5 REPLIES 5

Gurpreet07
Mega Sage

Hi Sweta,

 

The published can be changed from search sources for knowledge. If you replace the highlighted line below then it should be fixed.

${Published}: {{item.publishedUTC}}

 

Gurpreet07_0-1699612677958.png

 

Hi Gurpreet, thanks for replying but i tried changing the published as mentioned by you but its not working, its still coming the same way. I even got a script include KBPortalServiceImpl, but i am not sure what changes needs to be done there. Can you please help me with this? I am not sure how to move further

Sweta10122
Tera Contributor

Hi Gurpreet, thanks for replying but i tried changing the published as mentioned by you but its not working, its still coming the same way. I even got a script include KBPortalServiceImpl, but i am not sure what changes needs to be done there. Can you please help me with this? I am not sure how to move further

Gurpreet07
Mega Sage

You are possibly using some custom widget for this but i tested this in pdi and its working as expected.

Gurpreet07_0-1699853536162.png