SmartObject tester and SharePoint column dates are not matching

  • 24 February 2022
  • 0 replies
  • 6 views

Userlevel 5
Badge +20
 

SmartObject tester and SharePoint column dates are not matching

kbt143048

PRODUCT
K2 blackpearl
BASED ON
K2 blackpearl (all)
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

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'.
 

Image

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:

 

SELECT * FROM [SharepointContentDatabaseName].[dbo].[AllUserData] ORDER BY [tp_Created] DESC
 


Image

 

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:

https://help.k2.com/onlinehelp/K2ForSharePoint/UserGuide/4.7/default.htm#ServiceBrokers/SharePoint/SharePoint_2013_Broker.htm?Highlight="You cannot manually register"

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.


0 replies

Be the first to reply!

Reply