This discussion is archived
3 Replies Latest reply: Feb 7, 2013 6:23 PM by 982753 RSS

Web services dateTime off by an hour randomly

982753 Newbie
Currently Being Moderated
I wrote code in C# to insert/update Account records:

System.DateTime tempDateTime = DateTime.Parse(customerRow["ENTERED_DATE"].ToString());
tempDateTime = tempDateTime.ToUniversalTime();
myAccData[0].IndexedDate0 = tempDateTime;
myAccData[0].IndexedDate0Specified = true;

Sometimes the datetime value uploaded is correct and other times it is off by one hour. It appears it's consistent within each month but it varies month to month and year to year. Here are the results of trying datetime uploads in different months.

Input Date
1/2/00 12:00 AM
2/2/00 12:00 AM
3/2/00 12:00 AM
4/1/00 11:00 PM
5/2/00 12:00 AM
6/2/00 12:00 AM
7/2/00 12:00 AM
8/2/00 12:00 AM
9/2/00 12:00 AM
10/2/00 12:00 AM
11/1/00 11:00 PM
12/2/00 12:00 AM
1/2/01 12:00 AM
2/2/01 12:00 AM
3/2/01 12:00 AM
4/2/01 12:00 AM
5/2/01 12:00 AM
6/2/01 12:00 AM
7/2/01 12:00 AM
8/2/01 12:00 AM
9/2/01 12:00 AM
10/2/01 12:00 AM
11/1/01 11:00 PM
12/2/01 12:00 AM
1/2/02 12:00 AM
2/2/02 12:00 AM
3/2/02 12:00 AM
4/1/02 11:00 PM
5/2/02 12:00 AM
6/2/02 12:00 AM
7/2/02 12:00 AM
8/2/02 12:00 AM
9/2/02 12:00 AM
10/2/02 12:00 AM
11/1/02 11:00 PM
12/2/02 12:00 AM
1/2/03 12:00 AM
2/2/03 12:00 AM
3/2/03 12:00 AM
4/1/03 11:00 PM
5/2/03 12:00 AM
6/2/03 12:00 AM
7/2/03 12:00 AM
8/2/03 12:00 AM
9/2/03 12:00 AM
10/2/03 12:00 AM
11/1/03 11:00 PM
12/2/03 12:00 AM
1/2/04 12:00 AM
2/2/04 12:00 AM
3/2/04 12:00 AM
4/1/04 11:00 PM
5/2/04 12:00 AM
6/2/04 12:00 AM
7/2/04 12:00 AM
8/2/04 12:00 AM
9/2/04 12:00 AM
10/2/04 12:00 AM
11/1/04 11:00 PM
12/2/04 12:00 AM
1/2/05 12:00 AM
2/2/05 12:00 AM
3/2/05 12:00 AM
4/1/05 11:00 PM
5/2/05 12:00 AM
6/2/05 12:00 AM
7/2/05 12:00 AM
8/2/05 12:00 AM
9/2/05 12:00 AM
10/2/05 12:00 AM
11/1/05 11:00 PM
12/2/05 12:00 AM
1/2/06 12:00 AM
2/2/06 12:00 AM
3/2/06 12:00 AM
4/1/06 11:00 PM
5/2/06 12:00 AM
6/2/06 12:00 AM
7/2/06 12:00 AM
8/2/06 12:00 AM
9/2/06 12:00 AM
10/2/06 12:00 AM
11/1/06 11:00 PM
12/2/06 12:00 AM
1/2/07 12:00 AM
2/2/07 12:00 AM
3/2/07 12:00 AM
4/2/07 12:00 AM
5/2/07 12:00 AM
6/2/07 12:00 AM
7/2/07 12:00 AM
8/2/07 12:00 AM
9/2/07 12:00 AM
10/2/07 12:00 AM
11/2/07 12:00 AM
12/2/07 12:00 AM
1/2/08 12:00 AM
2/2/08 12:00 AM
3/2/08 12:00 AM
4/2/08 12:00 AM
5/2/08 12:00 AM
6/1/08 11:00 PM
7/1/08 11:00 PM
8/1/08 11:00 PM
9/2/08 12:00 AM
10/2/08 12:00 AM
11/2/08 12:00 AM
12/2/08 12:00 AM
1/2/09 12:00 AM
2/2/09 12:00 AM
3/2/09 12:00 AM
4/2/09 12:00 AM
5/2/09 12:00 AM
6/1/09 11:00 PM
7/1/09 11:00 PM
8/1/09 11:00 PM
9/2/09 12:00 AM
10/2/09 12:00 AM
11/2/09 12:00 AM
12/2/09 12:00 AM
1/2/10 12:00 AM
2/2/10 12:00 AM
3/2/10 12:00 AM
4/2/10 12:00 AM
5/1/10 11:00 PM
6/1/10 11:00 PM
7/1/10 11:00 PM
8/1/10 11:00 PM
9/2/10 12:00 AM
10/2/10 12:00 AM
11/2/10 12:00 AM
12/2/10 12:00 AM
1/2/11 12:00 AM
2/2/11 12:00 AM
3/2/11 12:00 AM
4/2/11 12:00 AM
5/1/11 11:00 PM
6/1/11 11:00 PM
7/1/11 11:00 PM
8/2/11 12:00 AM
9/2/11 12:00 AM
10/2/11 12:00 AM
11/2/11 12:00 AM
12/2/11 12:00 AM
1/2/12 12:00 AM
2/2/12 12:00 AM
3/2/12 12:00 AM
4/2/12 12:00 AM
5/2/12 12:00 AM
6/2/12 12:00 AM
7/2/12 12:00 AM
8/2/12 12:00 AM
9/2/12 12:00 AM
10/2/12 12:00 AM
11/2/12 12:00 AM
12/2/12 12:00 AM


Any thoughts? Thanks for any input.
  • 1. Re: Web services dateTime off by an hour randomly
    989625 Newbie
    Currently Being Moderated
    One thing I notice is every time it is the 1st of the month the time shows as 11 instead of 12. could this be a Datetime.parse issue or have you verified the SOAP request is good?
    Would you mind posting the SOAP request as well as the raw data from the table.
  • 2. Re: Web services dateTime off by an hour randomly
    982753 Newbie
    Currently Being Moderated
    Hey! Thanks for the interest in the resolution of this.

    The anomaly you noticed is a result of it "rolling back an hour" - all input times are on the 2nd day of the month at midnight, but subtract a hour and we go back to the the first of the month at 11 P.M.

    I'll test it with soapui and post the input and the resulting values created.
  • 3. Re: Web services dateTime off by an hour randomly
    982753 Newbie
    Currently Being Moderated
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/ecbs/account/10/2004" xmlns:data="urn:/crmondemand/xml/Account/Data">
    <soapenv:Header/>
    <soapenv:Body>
    <ns:AccountInsert_Input>
    <data:ListOfAccount lastpage="1" recordcount="1">
    <data:Account operation="2">
    <data:IndexedDate0>2008-06-02T05:00:00Z</data:IndexedDate0>
    <data:AccountName>SOAPTEST8</data:AccountName>
    </data:Account>
    </data:ListOfAccount>
    </ns:AccountInsert_Input>
    </soapenv:Body>
    </soapenv:Envelope>

    The time reads midnight in 6/2/2008 12:00 A.M. in Oracle CRM, but at this time the offset should only be 4 hours from my location in EST- So it really should appear to be 6/2/2008 1:00 A.M.

    If I set the time as 2008-05-02T05:00:00Z in the soap request, the time appears to be 1 A.M. in CRM which is consistent with EST.

    During 2008, daylight savings time lasted from Sun March 9 02:00 till Sun November 2. So the variability within this time frame is puzzling.

    At the moment I am forgoing those previous results as I believe after reading there are some issues with Windows XP and time zone info. (http://msdn.microsoft.com/en-us/library/system.timezoneinfo.local.aspx)

    Just uploading the same time at the same utc offset for different months/years (e.g. <data:IndexedDate0>yyyy-MM-02T05:00:00Z</data:IndexedDate0>) gives the expected results in CRM except for the years 2008-2011 between ~ the months of May and August. Sorry to change the dataset, but revisiting and learning about those issues with XP and the time zone narrowed some of the problem.

    1/2/2007 0:00
    2/2/2007 0:00
    3/2/2007 0:00
    4/2/2007 1:00
    5/2/2007 1:00
    6/2/2007 1:00
    7/2/2007 1:00
    8/2/2007 1:00
    9/2/2007 1:00
    10/2/2007 1:00
    11/2/2007 1:00
    12/2/2007 0:00

    1/2/2008 0:00
    2/2/2008 0:00
    3/2/2008 0:00
    4/2/2008 1:00
    5/2/2008 1:00
    6/2/2008 0:00
    7/2/2008 0:00
    8/2/2008 0:00
    9/2/2008 1:00
    10/2/2008 1:00
    11/2/2008 1:00
    12/2/2008 0:00

    1/2/2009 0:00
    2/2/2009 0:00
    3/2/2009 0:00
    4/2/2009 1:00
    5/2/2009 1:00
    6/2/2009 0:00
    7/2/2009 0:00
    8/2/2009 0:00
    9/2/2009 1:00
    10/2/2009 1:00
    11/2/2009 0:00
    12/2/2009 0:00

    1/2/2010 0:00
    2/2/2010 0:00
    3/2/2010 0:00
    4/2/2010 1:00
    5/2/2010 0:00
    6/2/2010 0:00
    7/2/2010 0:00
    8/2/2010 0:00
    9/2/2010 1:00
    10/2/2010 1:00
    11/2/2010 1:00
    12/2/2010 0:00

    1/2/2011 0:00
    2/2/2011 0:00
    3/2/2011 0:00
    4/2/2011 1:00
    5/2/2011 0:00
    6/2/2011 0:00
    7/2/2011 0:00
    8/2/2011 1:00
    9/2/2011 1:00
    10/2/2011 1:00
    11/2/2011 1:00
    12/2/2011 0:00

    1/2/2012 0:00
    2/2/2012 0:00
    3/2/2012 0:00
    4/2/2012 1:00
    5/2/2012 1:00
    6/2/2012 1:00
    7/2/2012 1:00
    8/2/2012 1:00
    9/2/2012 1:00
    10/2/2012 1:00
    11/2/2012 1:00
    12/2/2012 0:00

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points