How to Set Time Zone in Office 365 using CSOM ?

In Office 365, we can set the Time zone settings for a site collection under Regional Settings. You always provide time zone while creating a site Collection, In this article, I’m providing you the sample code to set the Time Zone Settings using Client Side object model.

// Get access to source site
using (ClientContext context = new ClientContext(“”))
SecureString passWord = new SecureString();

foreach (char c in “*****”.ToCharArray()) passWord.AppendChar(c);

context.Credentials = new SharePointOnlineCredentials(“”, passWord);

// Actual code for Getting Client Context
Web web = context.Web;
webSite => webSite.Title);

RegionalSettings regSettings = web.RegionalSettings;


Microsoft.SharePoint.Client.TimeZone utcTimeZone = clientContext.Site.RootWeb.RegionalSettings.TimeZones.Where(timezone => timezone.Description == Constants.UtcTimeZone).FirstOrDefault();
if (utcTimeZone != null)

// Set the Time Zone
clientContext.Site.RootWeb.RegionalSettings.TimeZone = utcTimeZone;



Please read my Previous article to know about getting the time zone using CSOM code.

Happy SharePointing folks 🙂 Hope it heps!!

Leave a Reply

Your email address will not be published. Required fields are marked *