Datetime Comparison With Localize

1
Hi there, I've got an entity (Promotion) with two datetime attributes (FromDate, ToDate). These two attributes have their localize settings set to "NO". I then have a datetime variable (AppDate) set to trimToDays([%CurrentDateTime%]). I now retrieve the first promotion where the application date is Greater than equal to the FromDate and less than the ToDate. For some reason, if the FromDate is today, the retrieve does not return anything. After I go and update the From Date in the database by -2hrs, it works again. This looks alot like a locale problem, but I have no idea where to start. A set the log levels on Connectionbus_Retrieve to Trace, and even there it seems to compare the correct dates (21-11-2011 00:00:00.000 with 21-11-2011 12:00:00:000 AM). Any help/explanation would be greatly appreciated. Regards Frikkie
asked
1 answers
3

Dates and times have been improved a lot in version 3.0, the main difference is that server time is never used in any calculation except for scheduled events. It could very well be that trimToDays used to work based on server time in version 2.5.5.1. If you can, I suggest upgrading to version 3.0.

answered