SharePoint Online: How to Change Date Format to “DD/MM/YYYY”?

Requirement: Change the Date format to “DD/MM/YYYY” in SharePoint Online.

How to Set Date Format in SharePoint Online?

By default, SharePoint Online sites display the dates in US format (MM/DD/YYYY). You may want to change the date format based on your country. Let’s see how to set the date format for a SharePoint Online site:

  • Open your SharePoint site in the web browser
  • Click on Settings gear >> Click on Site Information >> View all site settings (URL shortcut: /_layouts/15/settings.aspx)
  • On the Site settings page, Under Site Administration, click on the “Regional settings” link.
  • Click on the Locale drop-down list arrow and select the locale to display dates. E.g., English United Kingdom sharepoint online change date format This changes the date format everywhere on the site. E.g., List, Columns including Created/Modified, recycle bin, etc.
    change date format in sharepoint online

Pretty simple, huh? The pain part is that regional settings should be configured for each site (subsite)! Changing regional settings in the top-level site doesn’t automatically propagate the change in its subsites.

Change Date Format in SharePoint Online using PowerShell

Here is how to change the date format (locale) in the SharePoint Online site using PowerShell:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
 
#Config parameters for SharePoint Online Site URL and Locale
$SiteURL = "https://Crescent.sharepoint.com"
$LocaleID ="2057" #English - United Kingdom
 
#Get Credentials to connect
$Cred= Get-Credential
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
   
#Set up the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
$Ctx.Credentials = $credentials

#Get Regional Settings of the Web
$Web = $Ctx.Web
$Ctx.Load($web)
$Ctx.Load($Web.RegionalSettings)
$ctx.ExecuteQuery()
 
#Update the LocaleID of the site
$Web.RegionalSettings.LocaleId = $LocaleID
$Web.Update()
$Ctx.ExecuteQuery() 

Any new subsite you create will inherit the Regional Settings from its parent site!

Refer to this Microsoft documentation for all available Locale IDs: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a

Change Locale for All Sites in SharePoint Online Tenant

Using the PowerShell script, we can set the locale for all sites in SharePoint Online – tenant-wide. This script loops through all sites and changes the default locale. Just set $AdminSiteURL and $LocaleID variables in the script and provide the credentials to connect to the SharePoint Online Admin center once.

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
 
#function to change Locale in regional settings of a SharePoint Online site
Function Set-SPOLocale([String]$SiteURL,[String]$LocaleID, [PSCredential]$Cred)
{ 
     Try
     {
        #Set up the context
        $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
        $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
   
        #Get Regional Settings of the Web
        $Web = $Ctx.Web
        $Ctx.Load($web)
        $Ctx.Load($Web.RegionalSettings)
        $ctx.ExecuteQuery()
 
        #Update the LocaleID of the site
        $Web.RegionalSettings.LocaleId = $LocaleID
        $Web.Update()
        $Ctx.ExecuteQuery()
 
        Write-host -f Green "Locale has been updated for "$Web.Url
 
        #Get all subsites of the web
        $Ctx.Load($Web.Webs)
        $Ctx.executeQuery() 
        #Iterate through each subsites and call the function recursively
        Foreach ($Subweb in $Web.Webs)
        {
            #Call the function to set Locale for the web
            Set-SPOLocale -SiteURL $Subweb.URL -LocaleID $LocaleID -Cred $Cred
        }
    }
    Catch [System.Exception]
    {
        Write-Host -f Red "Error:"$_.Exception.Message
    }
} 
 
#Config parameters for SharePoint Online Admin Center and Locale description
$AdminSiteURL = "https://Crescent-admin.sharepoint.com"
$LocaleID ="2057"
 
#Get credentials to connect to the SharePoint Online Admin Center
$Credentials = Get-Credential
 
#Connect to SharePoint Online Tenant Admin
Connect-SPOService -URL $AdminSiteURL -Credential $Credentials
 
#Get all Site Collections and Iterate through
Get-SPOSite -Limit ALL | ForEach-Object { 
    Set-SPOLocale -SiteURL $_.URL -LocaleID $LocaleID -Cred $Credentials
}

You can also use PnP PowerShell to set the regional settings: How to Change Regional Settings in SharePoint Online using PowerShell?

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

8 thoughts on “SharePoint Online: How to Change Date Format to “DD/MM/YYYY”?

  • Thanks!! very helpful!

    will mention that it isn’t easy to find the site settings so who ever is looking this is it :
    http://****YOUR SP SITE ADDRESS****/_layouts/15/settings.aspx

    Reply
  • This does not address the confusion when Months are are not spelt out. i.e. There is no confusion when dates are display spelling out the month.
    Confusion is the result of all numbers — 3/5/2022 (is March 5th or 3rd May?)

    There is no confusion between MAR/5/2022 and 3/MAY/2022

    What is the process to have SharePoint display Months using the alphabet?

    Reply
  • This doesn’t affect any of the admin centre views or emails (e.g. access approval mails always come as mm/dd/yyyy). The US date format seems to be hard-coded or doesn’t make calls to tenant, user or browser settings. There seems to be little interest from Microsoft in making this a truly global product.

    Reply
  • How do you get sharepoint online to convert many types of date format inputs into one default type?

    Reply
  • The $ctx.ExecuteQuery() keeps giving me an error (401) Unauthorized, even though the user is a sharepoint primary admin… any ideas?

    Reply
  • Can we do it by folder. When folder get updated will show dd/mm/yyyy. Can we apply it to all sites?

    Reply
  • Nice, I was messing up javascript and calculated columns!

    Reply

Leave a Reply

Your email address will not be published.