DateTime from XML element is GMT?

Home Page Forums BizTalk 2004 – BizTalk 2010 DateTime from XML element is GMT?

Viewing 0 reply threads
  • Author
    Posts
    • #13038

      I am receiving an XML message with an element that has a schema data type of \”xs:DateTime\”.

      When I display using our debug facility, I specify something like this:

      message = \”date=\” & System.Convert.ToString(msgin.DateRequested);

      The message displays a perfect time but 7 hours earlier (we are in Mountain Standard Time), so obviously it’s showing me the date in GMT.

      I have tried displaying System.TimeZone.CurrentTimeZone.StandardName and it shows Mountain Time. This seems to be the region settings of the userid that is running the Biztalk Host.

      Any ideas are appreciated. I was thinking about trying to set the culture or using the TimeZone class, but I’m not sure it will fix. Also, if I run the same code with the same date/time in regular C# it works normally, for example:

      string strDate = \”2006-03-01T11:31:25.1406250-07:00\”;
      DateTime date1 =
      System.Convert.ToDateTime(strDate);
      System.Console.WriteLine(\”date=\” + date1);

      string showDate1 = System.Convert.ToString(date1);
      // I think Biztalk is treating Date/Time
      // element as DateTime type

      System.Console.WriteLine(\”showDate1=\” + showDate1);
      string showDate2 = System.Convert.ToString(strDate);

      System.Console.WriteLine(\”showDate2=\” + showDate2);

      Neal Walters
      http://Biztalk-Training.com

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.