Comparing Time Query

Hii everyone,

This is the time of Outlook

This is the Time of OTRS
“Changed”: “2019-12-12 09:52:51”, this is in UTC

How to Compare this 2 times

Thanks and Regards,

See this little piece of code to see if helps how can be done (in C#, but can give you an idea):

DateTime dt1 = DateTime.Now.AddHours(3);
DateTime dt2 = dt1.AddHours(3);

// change kind to unspecified
dt1 = new DateTime(dt1.Ticks, DateTimeKind.Unspecified);
dt2 = new DateTime(dt2.Ticks, DateTimeKind.Unspecified);

// append the offset for each time
var offset1 = new DateTimeOffset(dt1, TimeSpan.FromHours(3));
var offset2 = new DateTimeOffset(dt2, TimeSpan.FromHours(6));

// compare
bool areEqual = offset1.Equals(offset2); // true