Time zone and Date format is not reflecting on user records even though we updated the properties

pdurgapavan
Tera Contributor

We have updated date format to dd-MM-yyyy on glide.sys.date_format property and updated timezone to Europe/Brussels on glide.sys.default.tz properties. But both timezone and Date format are not reflecting on user records

pdurgapavan_0-1753796059593.png

pdurgapavan_0-1753796193667.pngpdurgapavan_1-1753796224490.png

could anyone help me why it's not reflected on user records and it got reflected on each and every user preferences.

 

@Ankur Bawiskar 

@Dr Atul G- LNG 

 

1 ACCEPTED SOLUTION

@pdurgapavan 

changes to system property won't update the sys_user records.

As already informed you will have to run script to clear the timezone field for sys_user records.

Set date_format and time_zone as Empty string by running script

var gr = new GlideRecord('sys_user');
gr.query();
while (gr.next()) {
    gr.time_zone = '';
    gr.date_format = '';
    gr.update();
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@pdurgapavan 

each user can override the date format or timezone from user preferences and this will override the system property.

When you update the system property it impact:

-> users which are newly created

-> user who have not set any preferences

Steps

-> manually clear the user preferences

-> also set the timezone as None in each of sys_user record, do this using scheduled job or fix script

check this

System and User Timezones in ServiceNow 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Time zone and Date format are reflecting on the user preferences but it's not reflecting on the user records. will it reflect on user records as well?

@pdurgapavan 

changes to system property won't update the sys_user records.

As already informed you will have to run script to clear the timezone field for sys_user records.

Set date_format and time_zone as Empty string by running script

var gr = new GlideRecord('sys_user');
gr.query();
while (gr.next()) {
    gr.time_zone = '';
    gr.date_format = '';
    gr.update();
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Chaitanya ILCR
Kilo Patron

Hi @pdurgapavan ,

it should work

Try clearing the cache and log out and log in 

try incognito/private window

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya