XML : Datetime field in XML gets an hour added for some reason when storing in database via SSIS

I have an XML that I'm pulling in, which has datetime fields:

  <startTime>2015-11-01T00:00:00-05:00</startTime>  <endTime>2015-12-01T00:00:00-05:00</endTime>    

The relevant portion of the XSD is as follows:

  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.foo.com/bar" xmlns:xs="http://www.w3.org/2001/XMLSchema">  ....  <xs:element minOccurs="0" name="startTime" type="xs:dateTime" />  <xs:element minOccurs="0" name="endTime" type="xs:dateTime" />    

When I process the file using SSIS, I'm using an XML Source component that fetches data from the file and loads it into a table.

For some strange reason, when the load into the table is done (and this only happens when I use 2015-11-01 as the start date), the startDate field gets an extra hour added to it. It appears as follows in the table:

  2015-11-01 01:00:00.000    

This only happens when using November 1st 2015 as the startDate, I'm assuming it's because the DST change was on November 1st, setting time back (I'm in eastern time zone) but if anything, it should have impacted things at 2:00am, subtracting one hour, and not adding.

I'd appreciate any help in figuring out why this is happening. Thanks!

No comments:

Post a Comment