Tuesday, May 17, 2016

Incorrect date format in the content editor for date fields in Sitecore

An issue that comes up with non-US Sitecore implementations of Sitecore is the default format of the dates in the Sitecore content editor. By default they will appear as MM/dd/yyyy where we would likely want them in the dd-MM-yyyy format.

US date format
This actually comes back to the backend language/localization of the Sitecore web site - which by default is set to EN (US language). To get the correct format showing, you will need to edit the DefaultRegionalIsoCode setting in Sitecore configuration to en-GB or another supported language.

GB date format
A patch file to change this setting would be:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="DefaultRegionalIsoCode">
        <patch:attribute name="value">en-GB</patch:attribute>
      </setting>
    </settings>
  </sitecore>
</configuration>

2 comments:

  1. Hello Ryan,

    Did you know how to change the format of date in sitecore editor?

    ReplyDelete
    Replies
    1. A user can visit the control panel, and then under "My Settings" the "Region and language options" will allow them to change the format as well.

      Delete