mardi 16 décembre 2014

Strange Datetime behaivour



I have a problem with an Event Rechiver. During ItemAdding() i set some datetime afterproperties.


This is triggered in 2 ways.


1: When a user create a new list item. 2: When a scheduled job created a new list item.


If i debug the code setting the afterproperties string, all looks the same.


But once its saved 1 hour is substracted from the datetimes the created scheduled job.


This is what it looks like in the database:



tp_DocId tp_Modified tp_Created tp_ColumnSet
498854B8-351B-4739-942D-0EC54A75323D 2014-12-16 14:41:57.000 2014-12-16 14:41:57.000 <bit1>0</bit1><datetime1>2014-12-16T15:12:11</datetime1><datetime2>2014-12-16T18:42:11</datetime2><datetime4>2014-12-16T14:42:11</datetime4><int5>1</int5><int8>1</int8><int9>4</int9><int13>1</int13><nvarchar1>SLATest-84</nvarchar1><nvarchar3>A - Kritisk</nvarchar3><nvarchar4>10 - Ny</nvarchar4><nvarchar5>Event</nvarchar5><nvarchar7>Timebaseret</nvarchar7><nvarchar17>Test 37</nvarchar17><sql_variant1 xmlns:xsi="http://ift.tt/ra1lAU" xmlns:sqltypes="http://ift.tt/1o3ANS9" xsi:type="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlSortId="0" sqltypes:sqlCollationVersion="0" sqltypes:sqlCompareOptions="IgnoreCase" sqltypes:maxLength="4000">Event</sql_variant1>
645FC470-07C2-4403-900E-B3D36EB5FFBE 2014-12-16 14:37:36.000 2014-12-16 14:37:35.000 <bit1>0</bit1><datetime1>2014-12-16T14:07:48</datetime1><datetime2>2014-12-16T17:37:48</datetime2><datetime4>2014-12-16T13:37:48</datetime4><int5>1</int5><int8>1</int8><int9>4</int9><int13>1</int13><nvarchar1>SLATest-83</nvarchar1><nvarchar3>A - Kritisk</nvarchar3><nvarchar4>10 - Ny</nvarchar4><nvarchar5>Event</nvarchar5><nvarchar7>Fast aftale</nvarchar7><nvarchar17>Test 36</nvarchar17><sql_variant1 xmlns:xsi="http://ift.tt/ra1lAU" xmlns:sqltypes="http://ift.tt/1o3ANS9" xsi:type="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlSortId="0" sqltypes:sqlCollationVersion="0" sqltypes:sqlCompareOptions="IgnoreCase" sqltypes:maxLength="4000">Event</sql_variant1>


The Created time is Correct. There are 4 min between the to items beeing created. But if we look at the datetime values in the xml there is suddenly 1 h 4 min between.


These datetimes are the afterproperties the code sets. And during creating in code there is only 4 min between as expected.


Can anyone tell me where the -1 hour could come from.


Both the job and the webapp containing the UI run under the same user account. All time calculations are done Using UTC time and are transformed to a string using SPUtility.CreateISO8601DateTimeFromSystemDateTime()








0 commentaires:

Enregistrer un commentaire