sharepoint-2010sql-server-2008-r2bcs

Timestamp in Sharepoint external content type not matching value in SQL table


I have an external content type in SharePoint 2010 pulling data from a SQL 2008R2 DB using BCS. All the data comes back fine but the Time stamp column is off by 2 hours when I compare the values displayed in the Read List with the values returned when I query the DB in Management Studio. I've attached a picture with an example:

Example

The times displayed in the browser are 4 hours earlier than the Time stamp returned by Management Studio. I've checked the Date and Time settings on both the client and server and they are fine. Any ideas what could cause this?


Solution

  • Check the normalisation settings for your BDC.

    Make sure you set it like this:

    <TypeDescriptor TypeName="System.DateTime"
     Name="YourDate" DefaultDisplayName="Your Date">
     <Interpretation>
      <NormalizeDateTime LobDateTimeMode="Local" />
     </Interpretation>
    </TypeDescriptor>
    

    http://www.shillier.com/archive/2010/09/01/why-are-my-date-fields-wrong-in-business-connectivity-servces.aspx