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.
K2 SmartForms SharePoint List – The displayed date is behind one day when adding a new list item, where a Date field is set to only Date in K2.
Before You Begin
Please note if you decide to use the K2 Date data type, it will not be doing a conversation on a date as this is not something available out-of-the box.
K2 Date/Time data type is the correct data type to use.
This is observed as by design. SharePoint will always work with Date/Time. It saves in Date/Time even if you indicate Date only.
In the following scenario, a user saves a date (for example 15/06/2017 - even if it is Date only) using the Sharepoint Form, SharePoint automatically converts the Date to (15/06/2017 07:00:00AM) and saves it. Later on, SharePoint knows that it needs to convert back from15/06/2017 07:00:00AM to 15/06/2017 12:00:00AM . When the user views this information, there is no issue here with the SharePoint form as it shows the same day.
When a user saves a date using the K2 form, it sends in15/06/2017, but SharePoint saves as15/06/2017 12:00:00AM. When it returns for viewing, SharePoint still does its conversion for viewing: in this case 15/06/2017 12:00:00AM will be converted to 14/06/2017 05:00:00PM which is now the previous day, hence the issue. K2 is corrected because it is sending in a date only for a date only column. It is SharePoint that goes and saves a time and does conversions.
The best practice is to default to use Date/Time property in K2 and not Date property only. This way, it will send a Date/Time value to SharePoint.