You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I use a Time zone different than the "Eastern Standard Time" I receive the error:
ServiceException: Code: BadRequest
Message: Invalid filter clause: The DateTimeOffset text '2023-09-28T21:14:43.4437014' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
Inner error:
AdditionalData:
date: 2023-09-29T15:45:02
request-id: ***
client-request-id: ***
ClientRequestId: ***
To Reproduce
Steps to reproduce the behavior:
This is how I create an instance of MicrosoftEmailHelper:
MicrosoftEmailHelper emailHelper = new MicrosoftEmailHelper();
TimeZoneInfo indiaTimeZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
DateTimeOffset indiaTime = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, indiaTimeZone );
This is my request:
return client.Me.MailFolders.Inbox.Messages.Request()
.Filter(filter) //can't use order by when use filters
.Select(m => new { m.Subject, m.ReceivedDateTime, m.From, m.Body })
.GetAsync().Result;
I create the date this way: string filter = $"startswith(subject, '{subject}') and ReceivedDateTime ge {received_from.ToString("o")}";
As a result string within filter will be: startswith(subject, 'SUBJECT OF MY EMAIL') and ReceivedDateTime ge 2023-09-28T21:10:36.2266736+05:30
Expected behavior
I should be able to obtain the list of emails
Current results
Error:
ServiceException: Code: BadRequest
Message: Invalid filter clause: The DateTimeOffset text '2023-09-28T21:14:43.4437014' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
Inner error:
AdditionalData:
date: 2023-09-29T15:45:02
request-id: ***
client-request-id: ***
ClientRequestId: ***
The text was updated successfully, but these errors were encountered:
Thank you for your answer @MartinM85. You were totally right. That solved my problem. I will read the guideline in the documentation about orderby. This is a code I inherited :(
Describe the bug
When I use a Time zone different than the "Eastern Standard Time" I receive the error:
ServiceException: Code: BadRequest
Message: Invalid filter clause: The DateTimeOffset text '2023-09-28T21:14:43.4437014' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
Inner error:
AdditionalData:
date: 2023-09-29T15:45:02
request-id: ***
client-request-id: ***
ClientRequestId: ***
To Reproduce
Steps to reproduce the behavior:
This is how I create an instance of MicrosoftEmailHelper:
This is my request:
I create the date this way:
string filter = $"startswith(subject, '{subject}') and ReceivedDateTime ge {received_from.ToString("o")}";
As a result string within filter will be:
startswith(subject, 'SUBJECT OF MY EMAIL') and ReceivedDateTime ge 2023-09-28T21:10:36.2266736+05:30
Expected behavior
I should be able to obtain the list of emails
Current results
Error:
ServiceException: Code: BadRequest
Message: Invalid filter clause: The DateTimeOffset text '2023-09-28T21:14:43.4437014' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
Inner error:
AdditionalData:
date: 2023-09-29T15:45:02
request-id: ***
client-request-id: ***
ClientRequestId: ***
The text was updated successfully, but these errors were encountered: