fbpx

The SharePoint 2010 server is always set to a specific time zone. Users from all over the world can change the time zone by using “My regional settings”. I wanted to achieve this programmatically as a batch operation.

To do this, I have used the following code.

SPRegionalsettings spRegnal= new SPRegionalSettings(web, true);
spRegnal.TimeZone.ID = 2 ;     // Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London
User.RegionalSettings= spRegnal ;

The SPRegionalSettings takes two parameters, the SPWeb and a Boolean. Set the time zone ID and finally get the SPUser object and assign the regional settings to that user.

 

About Us

Follow Us

Email: contact@keapoint.com
Phone:  0208 7852 888

Registered Address: 1 Amber Close, Reading, RG6 7ED. United Kingdom

Company No. 11586817