Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change datetime field format on Sitecore backend

Tags:

sitecore

Does anyone know the easiest way to change DateTime field format on Sitecore backend (Content Editor). My current Sitecore shows date in US format (which is MM/dd/yyyy); but I want to use the format dd/MM/yyyy.

Any help would be appreciated.

Thank you.

like image 371
Harry Ninh Avatar asked Dec 25 '22 16:12

Harry Ninh


2 Answers

This is controlled by the language the shell/Sitecore backend is running in (not the content language). By default Sitecore uses english (US). If you run with this language it will show the format in MM/dd/yyyy.

If you have a danish language it will show dd-MM-yyyy. If you need an english language with another date format, you should probably create a en-UK language in the core database, and have your users log in to that format.

You can also set the default language for the content editor by setting the following configuration in the web.config

<setting name="ClientLanguage" value="da" />
like image 173
Jens Mikkelsen Avatar answered Dec 28 '22 09:12

Jens Mikkelsen


From Ben's suggestion, I've figured out what config I should change to achieve my goal: Since my region is using UK format, I need to change this for all users; and the config I need to change is DefaultRegionalIsoCode.

<setting name="DefaultRegionalIsoCode" value="en-GB" />

Jen's answer is also helpful, but it addresses another issue. From what I've researched, changing ClientLanguage needs to install additional package and may translate all texts/messages of the whole CMS.

http://sdn.sitecore.net/Resources/Client_Translations/CMS%20Client%20Translations/7,-d-,0,-d-,x.aspx

like image 38
Harry Ninh Avatar answered Dec 28 '22 09:12

Harry Ninh