SYMPTOM:
The data in the XML for Datetime is in format "2014-05-21 10:10:10 PM". However, when using the XQuery report to retrieve data from the XML file, it is incorrect returned and displaying as "2014-05-21 1:00:00 PM".
CAUSE:
The data format “2014-05-21 10:10:10 PM” is not the standard format for DateTime in XML. The data should be in a format such as this “2014-05-21T22:10:10” as per http://www.w3.org/TR/xmlschema-2/#dateTime.
ACTION:
There are two workarounds can be applied. One is to move the format style to “2014-05-21T22:10:10” in the XML file. Another is to change the column to be xs:string in the XQuery report definition although the attribute is set to ‘Datetime’.
NOTE:
The issue also happens when running XQuery report using JSON web service. The workaround addressed here can also be applied in such scenario.