How to Get the Time zone settings in Office 365 using CSOM?

In Office 365, we can  get 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 get 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;

//To get regional settings properties
Microsoft.SharePoint.Client.TimeZone currentTimeZone = regSettings.TimeZone;

//To get the TimeZone propeties for the current web region settings


Please read my next article on how to set the time zone using CSOM.

Happy Share Pointing 🙂 Hope it helps you guys!!

Leave a Reply

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