Filter REST call on SharePoint with DateTime value

As you may know, using the REST API in SharePoint 2010 is a very flexible and powerful way to retrieve data from SharePoint. I love the way I can use the ListData.svc to get data form lists and document libraries. Finding the correct syntax however can sometimes be challenging…

Today, I found myself looking for a way of retrieving items from a calendar list. Getting the calendar items themselves wasn’t a problem, try to filter the items for only the current items (today and greater) was.

After some Googling and several syntax attempts I found out the right way to do it.
Say I only want to  get calendar items that start  on November 23, 2011 or beyond…


Works like a charm…

Update March 27, 2012
Because of the question Michal asked I retested some scenario’s. It turns out you cannot filter on time values. Real bummer :(


will filter on dates, greater or equal than 2011-11-23. It will not filter on 09:00, so an event taking place at i.e. 08:00 will be returned in the result set.

Therefore, there is no need to specify the time and you can filter without the time part of the query, like this:


If I’m wrong, please let me know…


This entry was posted in SharePoint 2010. Bookmark the permalink.

7 Responses to Filter REST call on SharePoint with DateTime value

  1. Caspar says:

    Does it work for recurring events? Just asking…
    If so, you’ve landed another job. :D

  2. Ernst Wolthaus says:

    Unfortunately, this will not retrieve the recurring calendar items…
    If you want to get recurring calendar items with client side code, I suggest you use SPServices. Please take a look at this thread:

  3. Michal Hainc says:

    hi, for me this does not return correct results

    it returns an appointment starting on 22.03.2012 16:00 and ended 17:00

    • Ernst Wolthaus says:

      Hi Michal,

      Good question! I’ve tested your filter string and it turns out you can filter with dates but NOT with time. Real bummer :(

      I have updated the blog post accordingly.

      • Michal Hainc says:

        Hi Ernst thank you for updating the blog post, … yes… it is a bummer indeed…
        and I feel like there is million of such bummers hidden in the sharepoint monster… :(

        going to think about a workaround

  4. Pingback: SharePoint 2013 et l’agrégation de données provenant du SI puis exposition à une application mobile | SharePoint 2013 - Blog technique d'Alexandre DAVID

  5. Pingback: REST API filter by start and end dates using 'today' | DL-UAT

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>