Using caml query I get Calender Events but Time will be changes..How to get server Time zone ..This return time +5.30 hrs.

  CamlQuery camlQuery = new CamlQuery();
            camlQuery.ViewXml = "<View><Query><Where>" +
                              "<DateRangesOverlap><FieldRef Name=\"EventDate\" />" +
                              "<FieldRef Name=\"EndDate\" />" +
                              "<FieldRef Name=\"RecurrenceID\"/>" +
                              "<Value Type=\"DateTime\"><Month /></Value></DateRangesOverlap>" +

  ListItemCollection collListItem = oList.GetItems(camlQuery);


  foreach (ListItem oListItem in collListItem)

                var Title = oListItem["Title"] != null ? oListItem["Title"].ToString() : "";
                var EventDate = oListItem["EventDate"] != null ? oListItem["EventDate"].ToString() : "";
                var EndDate = oListItem["EndDate"] != null ? oListItem["EndDate"].ToString() : "";
                var Location = oListItem["Location"] != null ? oListItem["Location"].ToString() : "";
                var Description = oListItem["Description"] != null ? oListItem["Description"].ToString() : "";

  Calender item = new Calender();

                item.Title = Title;
                item.EventDate = Convert.ToDateTime(EventDate);
                item.EndDate =Convert.ToDateTime(EndDate);
                item.Location = Location;
                item.Description = Description;


In Calender It display date as:means start Time is 3PM to 4PM enter image description here

but it return as: enter image description here

  • what is the CAML query you are using ? Commented Jun 15, 2017 at 6:36
  • I add caml query please check it.. Commented Jun 15, 2017 at 6:37
  • Thanks, are you binding the results to html somewhat as new Date(item.EventDate) ? Commented Jun 15, 2017 at 6:44
  • actually I have use it in C#...I bind this to DateTime object Commented Jun 15, 2017 at 6:45
  • can you also add that code in the question ? Commented Jun 15, 2017 at 6:48

2 Answers 2


try the below line.

 item.EventDate = TimeZone.CurrentTimeZone.ToLocalTime(EventDate);

I had seen many a times people are struggling with DateTime field in SharePoint. SharePoint internally store DateTime filed into UTC format.

So to solve your problem you need to convert the UTC time in accordance with your sever time zone. You can get the web time zone using SPWeb object. Following is the property you need to use.


Also if you are using CSOM C# then you need to refer to Web object instead of SPWeb.

  • Not able to use SPWeb object..I only worked using Client context object. Commented Jun 15, 2017 at 8:27
  • You can use ClientContent.Current.Web object to get RegionalSettings.TimeZone property. Commented Jun 15, 2017 at 10:57
  • Also i was trying out something with SP page JS global variable and found you can extract web application time zone using JS on page as well using _spPageContextInfo.webTimeZoneData property. Commented Jun 16, 2017 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.