I need to analyze the "EndDate" of events inside SharePoint 2013 standard calendar items from a list item event receiver and cancel some modifications based on time of this date. I have this code for obtaining the updated date:
string strEnd = (string)properties.AfterProperties["EndDate"];
Unfortunately, the date is coming as string of the such format:
As you can see, there's no any time zone information. When the item is being updated from standard SP web interface, the date string looks like a local time. But if the item is being updated from Outlook, the date string looks like the date which is shifted due to the timezone differences.
The problem is that because of lack of the timezone info I cannot differentiate between this two cases. There's the "TimeZone" column inside calendar list but it returns nothing and I'm not sure is it related to problem.
At the same time, the SharePoint itself somehow knows the right time because in the web interface it shows the right time regardless of the source of the changes.
How should I deal with this situation?