The CreatorCon Call for Content is officially open! Get started here.

Add a new date format [ jjj JJ/MM/AAAA HH:MM ]

Otmane FARAJ
Tera Contributor

Hi,

We would like to know whether it is possible to add a new date format [ jjj JJ/MM/AAAA HH:MM ] to the choices of the "date format" field in the User profile.

Regards

4 REPLIES 4

Shishir Srivast
Mega Sage

Hi Otmane,



I have tried to add date and i was able to select the same in sys_user table date field



find_real_file.png


find_real_file.png



but it has changed the date format everywhere with extra HH:mm


find_real_file.png


Hi,



I was able to change the format but adding JJJ is my need, exemple : Mon 12/09/2007 23:30



If you have any idea please let me know,



Thank you


johnolivermendo
ServiceNow Employee
ServiceNow Employee

Hey Otmane,



Try changing your date_format to "EEE MM/dd/yyyy". E is what you use to denote 'day name of the week'. I just tested it out and it worked for me.



You'll notice that I left out the HH:mm from the date format as that is something you set in the time_format choice list. (Or else you'll see the time format twice on all of your date fields). All of the date fields use a combination of the date_format and the time_format to show you exactly what you want. See below:


Screen Shot 2017-06-28 at 5.51.48 PM.png



This doc was very helpful in helping me find the JavaDoc that we base our time format in.


Global date and time field format


SimpleDateFormat (Java Platform SE 7 )


Yes, it's work, but try to edit a record, exactly a date time field in the form