Share via

Using "today" inside Query Template will work differently if we are using "SharePoint Search" vs "Microsoft Search"

john john Pter 1,550 Reputation points
2024-08-24T22:07:22.02+00:00

I have a SharePoint Online site collection with Pacific Time zone (US & Canada), and i have a Date/Time SharePoint site column named DueDate, and i created a RefinableDate00 which is linked to the site column crawl property.

Now i use this Query Template to get the items which have the DueDate equals Today inside PnP Modern Search Result web part:-

{searchTerms}
ContentType=Assets
(RefinableDate00=today )

I have noted a major differences how this Query template works when having SharePoint Search vs Microsoft Search, as follow:-

  1. let say i added 2 list items and i define its DueDate as follow:-

a) First Item:- 24 August @ 11:30 pm. where this date/time will be stored inside SharePoint in UTC time zone, so the value will be 25 August @ 6:30 am.

b) Second Item:- 24 August @ 12:00 am. where this date/time will be stored inside SharePoint in UTC time zone, so the value will be 24 August @ 7 am

  1. Now it is 24 August @ 2:30 pm Pacific Time + 9:30 pm UTC.
  2. when i run the above Query Template using the Microsoft Search, i will only get second item
  3. while when i run the above Query Template using SharePoint Search i will get the 2 list items.

so seems the SharePoint Search do respect the site time zone and get accurate results, since in my case the 2 items are on 24 August (based on the site time zone) and both items have their DueDate on 24 August based on the site time zone, while using Microsoft Search the search will be based on UTC and i will not get accurate results based on the site collection time zone.

so can anyone advice why we got this 2 behavior ? is this an issue in Microsoft Search?

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,991 Reputation points Moderator
    2024-08-26T06:10:50.1933333+00:00

    Hi @john john Pter,

    The behavior is by design. The difference in behavior between SharePoint Search and Microsoft Search is due to how they handle time zones. SharePoint Search respects the site time zone and returns accurate results based on the site collection time zone, while Microsoft Search is based on UTC and may not return accurate results based on the site collection time zone.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.