I am using the GetListItems web service to retrieve items from a list where my custom column UpdateCompleted is less than or equal to a given datetime. But, I noticed some weird behaviour of SharePoint 2007 going on. The query would perform differently when
I changed my regional settings on the site settings page of SharePoint! When regional settings were set to UTC my query would select the items, when in GMT it would not.
I have specified my query to use a DateTime in UTC form (ends with Z) and I have also specified DateInUtc to TRUE in the query options. So I would expect SharePoint to do a UTC date compare despite what the site regional settings are set to.
This is my query:
<Query><Where><And><Eq><FieldRef Name='Status'></FieldRef><Value Type='Text'>Unlocked</Value></Eq><Leq><FieldRef Name='UpdateCompleted'></FieldRef><Value Type='DateTime' IncludeTimeValue='TRUE'>2010-10-08T18:40:21Z</Value></Leq></And></Where></Query>
This is my query options: