简体   繁体   中英

How do I filter DateTime by specific Month and/or Day in Microsoft Graph?

I am looking for a way to get Users from Graph API whose CreatedDateTime are equal to a specific Month and Days are in range of 1st to DateTime.Now.Day. So for example:

  • I want to get users whose accounts were created in May and today is 2022.03.17 so the response I am looking for will be users who have CreatedDateTime Month == 5 and CreatedDateTime Day is between 1st and 17th and the year of creation does not matter.

Documentation says requests support ODataV4, I tried to filter my request like this:

month() and day() odatav4 operators seem to not be supported, adding ConsistencyLevel = eventual header does not help.

Is there any way I can filter Dates in Graph API just by specific months/days, ignoring year?

According to the documentation createdDateTime supports $filter with the following operators:

eq , ne , not , ge , le and in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM