$filter to return more than and equal to today

Didier 1 Reputation point
2021-11-29T13:15:53.323+00:00

I am developing the App that I am using Microsoft Graph to return from calendar outlook as below

"url": "/users/<UPN>/events?$select=subject,organizer,start,end,location&$top=25"

I am struggle to find the answer to filter the result only can display when the 'start' is greater than or equal tooday.

I know about $filter=start ge '2021-11-29'.

I need a today date.

Thank

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,486 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RajeshKumarMSFT 1,971 Reputation points Microsoft Vendor
    2021-12-24T11:12:03.387+00:00

    Hi @Didier ,

    Based on my analysis, I was able to replicate fetching events with -eq start/dateTime is not working as expected.

    To get all the events which are scheduled for today, you can use below workaround to suffice your request.
    Please use the below Graph API endpoint as an example.

    https://graph.microsoft.com/v1.0/users/{user-Id}/events?$filter=**start/dateTime** ge '2021-12-21T00:00:00Z' and end/dateTime lt '2021-12-22T00:00:00Z'

    • start/dateTime :-Please pass the today's date along with the time.
    • end/dateTime :- Please pass the next day's date along with the time.

    160164-filter.png

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have futrther questions about this answer, please click "Comment".

    1 person found this answer helpful.