We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DateComparisonType.ByDateTime seems to be ignoring seconds

i am building a query, i want to return all records since the last email was downloaded.
i convert the email message date to ToUniversalTime, add 1 second, but i always return the last returned email again.
am i missing something?

seems i need to add 5 seconds to clear the last email message, can this be improved?


I have observed the issue shared by you and have not been able to completely understand your requirements. Can you please elaborate what you want to achieve along with source file and working sample code. Please also share the desired result that you want to achieve on your end.

sorry for the delay, got side tracked on another module.
i am downloading email into a SQL database.
here is the query
Dim builder As ExchangeQueryBuilder = New ExchangeQueryBuilder()
builder.InternalDate.Since(CDate(strFromDate), DateComparisonType.ByDateTime)
Dim query As MailQuery = builder.GetQuery()
The variable strFromDate is loaded from the database, the date value from the most recent email+ 1 second.
the issue is the new downloaded emails contain the same messages previously downloaded if the date value is within a few seconds.

looking at the email message object, it would appear the email message has two different date values, and internal date and a second date field. i can figure this out, sorry for wasting your time.

still need a little advise on this.
i will attempt to upload a screenshot below, here are the values from the ExchangeMessageInfo object.
date: #3/27/2020 11:18:19 AM#
InternalDate: #3/27/2020 11:18:22 AM#
if you look at the date and the internal date, they are 3 seconds apart. no idea why, but had hped this was the issue.
my builder query looks like {(‘InternalDate’ >= ‘03/27/2020 11:18:27’)}

the problem is the message above is returned everytime, but the query is 5 seconds past the message InternalDate.
What am i missing?

image.png (27.6 KB)


I have observed the image shared by you and like to share that we need to access the actual file and used sample code to observe this and share feed back. The API reads as it is what is stored in MSG or EML.

the issue is the builder clause is not functioning correctly.
builder.InternalDate.Since(CDate(strFromDate), DateComparisonType.ByDateTime)
the since clause does not behave as expected. i needed to changes this to greater
now it works as expected.


It’s good to know things are fine on your end.