I'm trying to filter a list using the REST service. The column im trying to filter is the default column "Modified". My problem is: I can get all itens created today, but not only the items created after noon. It seems like Sharepoint is ignoring the time factor of a datetime column and only comparing the date.

I tried to use the Hour() function but I get a 400 (bad request) error.


SharePoint 2010 REST Interface expects the following format for the Date column:

/_vti_bin/listdata.svc/ListName?$filter=Modified gt datetime'YYYY-MM-DDT12:00:00Z'

JavaScript example

var listTitle = "Requests";
var minDate = getMinDate();
var endpointUrl = "/_vti_bin/listdata.svc/" + listTitle + "?$filter=Modified gt datetime'" + minDate.toISOString() + "'";
$.getJSON(endpointUrl, function(data) {

function getMinDate()
    var d = new Date(); 
    d.setMonth(d.getMonth() - 1);
    return d;
| improve this answer | |

Well it seems to be impossible, so i worked around and used the client object model... shame...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.