SmartObject tester and SharePoint column dates are not matching
kbt143048
PRODUCTIssue
There is an inconsistency between the SmartObject tester and SharePoint on the date field. In SharePoint site you can see the dates as '3/8/2018 6:51 PM' but when you run the SmartObject for the same document list in tester, it is showing as '3/9/2018 02:51AM'.
Symptoms
This was an all-in-one environment that was hosting the SQL server, K2 server and the Sharepoint Farm. It was also where the browser and SmartObject Service Tester tool was being executed from. It was determined that although the server was in the UTC-8 Pacific timezone, the Sharepoint site had its regional setting set to the UTC Dublin, Lisbon, London timezone (this setting is per site).
Although a SharePoint 'Date and Time' type > 'Date Only' field was being used; this was still stored in Sharepoint in a DateTime Format and can be verified with:
It is likely the difference in the timezone settings that is resulting in this incorrect date.
The SmartObject of this case was created from SharePoint content service broker. Please also note that the manual creation of the Sharepoint 2013 service instance is not recommended/supported. Please use the K2 App to manage this service instance and the K2 Application to create SmartObjects:
Troubleshooting Steps
After setting the Regional Settings for this site to match the server timezone, the date in the Sharepoint Library and SmartObject Service Tester tool is now matching.
Depending on the usage of this Date field; and if there is a timezone difference between the K2 Server and Sharepoint Regional Settings, you could also store this field in a Text field or use inline functions and conditional statements to cater for this difference.