Tuesday, March 31, 2009

Change the Regional Setting of Site

You could change the regional setting of the site by browsing to Site Actions > Site Settings > Regional Settingsimage

You could also change the Locale using the following code:

using (SPSite site = new SPSite("http://SITE"))
{
    using (SPWeb web = site.OpenWeb())
    {
        SPRegionalSettings newRegionalSettings = new SPRegionalSettings(web);

        // Change to Australia
        newRegionalSettings.LocaleId = 3081; 
        web.RegionalSettings = newRegionalSettings;
        web.Update();
    }
}

0 comments: