SharePoint – Configure 24 hour format on all sites


Hello everyone. Today I got the request to change the default time format used on all SharePoint sites to the 24 hour format and I thought I should share how to do this.

Here is the script:

#Add SharePoint PowerShell SnapIn if not already added

if((Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
}

$AllSPSites = Get-SPSite -Limit All

foreach($SPSite in $AllSPSites)
{
foreach($SPWeb in $SPSite.AllWebs)
{
$SPWeb.RegionalSettings.Time24=$True
$SPWeb.Update()
$SPWeb.Dispose()
}
}

All you have to do is to run this script on one of your SharePoint Farm servers as SharePoint Administrator and your work is done. That´s it.

As always you can download my script from here.

Sources:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.allwebs.aspx

http://social.technet.microsoft.com/Forums/sharepoint/en-US/397a8fed-d589-4174-8d2a-9350262a142e/change-locale-and-timecalendar-format-for-400-site-collections?forum=sharepointadminprevious

http://sharepoint.stackexchange.com/questions/17247/spsite-allwebs-returns-error

Advertisements
Tagged ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: