I am trying to use the listdata.svc to retrieve list items and one of the filter parameters is a datetime field. So the request looks like this:
http://moss2010/_vti_bin/ListData.svc/HeadLineNews?$filter=Active
eq true and EndDate ge datetime’2012-01-11T18:00:00′
I am getting items back with “EndDate” set to earlier time back from the request such as the following:
<d:EndDate m:type="Edm.DateTime">2012-01-11T12:00:00</d:EndDate>
I have tried to change the time in the EndDate parameter around in case this has something to do with client browser’s timezone settings( I have changed “18:00:00” to all 24 hours between “00:00:00 – 23:00:00”), but this doesn’t seem to be making a difference. However as soon as I change the date to a day earlier “2012-01-10T18:00:00”, it would start to return correct items.
Is it a known issue for ListData to ignore the time information for DateTime fields? Anybody have run into this before?
I have October 2011 Update on my SharePoint server.
I believe this is a known issue – or yet another gotcha in Sharepoint. I see the same behavior and have seen blog posts to this effect. My first thought was that it had to do with UTC vs local time. I’ve tried a variety of ISO 8601 formats for UTC and timezones, but in every case it seems to ignore the time component. The only workaround I can think of is to go ahead and return the whole set, then filter in whatever is consuming the data.
https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators