I am fairly new to SharePoint 2013 workflows with years of general C# and other SharePoint experience.
My problem is with timezones. I am developing a list workflow in Visual Studio 2013 which has to take some actions based on the value of a date only field of the current item in the list. I am retrieving the value of this field using GetDynamicValueProperties and assign it to a variable. However if I check this value, I can see that it is not correct as it is 23:00 on the day before the one I actually set for the list item. I am assuming this is because no matter being a date only field, behind the scenes it is still being stored in a regular DateTime object.
Because of this, all my date calculations are 1 day off (because I only use the date part). I have noticed that all the timezone specific classes and methods cannot be used within the workflow.
Is there any way I can correctly retrieve only the date part of this field value without hardcoding any offsets? I am preferably looking for a solution which does not include workarounds and hacks and works in all environments.
Background information: I have to execute tasks n days before this date at a given time (e.g. 8 AM). The second part is tricky too, as the time part will also be 1 hour off because of this. I am looking for a solution for this too.