In both cases I'd say the issue is that the TransactionDate field is not localized. If you set that to localized, I think the following should happen:
Case 1. the user selects 5-jun, interpreted as "5-jun 00:00 UTC+2 // 4-jun 22:00 UTC". Comparing to the currentdatetime will give you the result you want.
Case 2. The default transactiondate will be set to the same value as in your case (4-jun 22:30 UTC), but when shown to the user will be localized, and render as 5-jun
Of course, setting the TransactionDate to localized could have consequences for date handling elsewhere in your application. The data in your database won't be changed (that's always in UTC), but it will suddenly be shown in a localized way, which might cause your users some surprise.
*Edit: If you haven't seen it already, read this document, which will give you a lot of background info: https://world.mendix.com/display/refguide4/DateTime+handling+FAQ
*Edit 2 (Since this is not an option): If you want a date to be displayed the same all over the world, you're not actually talking about a real "date" or "date-time" instance. For instance, the 1st of january is not the same time-period all over the world. To prevent massive headaches in trying to do this with real datetime attributes anyway, I'd advise storing the transaction date as a string and doing any comparisons using that. If you want to do date comparisons, convert the string into a local time using parseDate, which will interpret it as a local time and probably make your case work.
(Also, please be very aware that this means that a transaction marked as "1st of january", might not have been created at the 1st of january in the timezone where the transaction is displayed, because of time-zone differences)
*Edit to reflect the 2014-06-10 changes:
To answer your last question: The best practices are: if the exact times matter, use localized dates. If the times do not matter, use UTC dates, and don't compare to currentDateTime but use {Begin,End}OfCurrentDayUTC. Keep in mind that BeginOfCurrentDayUTC might not have the same date part as BeginOfCurrentDay in this case (this is correct behaviour, and at the root of your question).
Comparing UTC datetimes to localized times (in different user timezones) is a recipe for headaches. If you want to compare an Unlocalized datetime to CurrentDateTime, convert everything to strings.
Regarding your two points: in both cases you are not actually comparing against the session datetime, you are comparing against [sessiondatetime - {timedifference vs UTC}]. In your case this has the effect of seeming to compare a sesison time, but you're still actually comparing a UTC datetime. This will probably give you a working workaround, but at the cost of always having to keep this in mind. Using strings prevents you from making mistakes, since you'll need to convert types anyway.
Finally, I agree that there are valid use cases for a date (i.e. NOT datetime) data type. This is one of them, birthdays are another, and there are probably more. The best way to increase priority for this is by filing feature requests.
Note to your additional finding: yes, the datepicker only adjusts the date. Normally, you'd use a time picker to adjust the time separately. In this case you can probably either use BeginOfCurrentDay as default, or use trimToDays().
I think you still both make a mistake. As in the documentation [%CurrentDateTime%] is always an UTC date / time. This time is for everybody the same wherever I am on the planet. And this should be used to check the transaction date of an process. This transaction date should be a localized attribute. This way I now in which time zone the user is (IF the timezone of the user is set at least). So the user that has his localtime of 0030 on the 6th of june in +1 GMT time zone has an UTC date time of 2330 on the 5th of june.
If you use the calendar widget to pick a date of lets say the 6th it will set the time to 00:00. But since localize is on the date that will be committed to the database will be the UTC date which in this case will be 5th 23:00.
Now if you compare the dates throughout the world you need to do this in UTC because only then all the date times can be compared to each other.
I could help the user if you displayed both times (so local time and UTC time, call it global time to make the concept easier for the end user). Not every user will grasp the concept of timezones but most will understand the concept of a time that is the same everywhere on this planet and that this time is used to compare the transactions.
Regards,
Ronald
[EDIT]
Copy paste of the documentation about currentDateTime: If I am comparing something with a [%CurrentDateTime%] token in a DataGrid, which time should it use as a constraint for a localized and for a non-localized date? So if I do an XPath with the following constraint [LocalDateAttr > [%CurrentDateTime%] or the following constraint [NotLocalDateAttr > [%CurrentDateTime%] what should I expect in the result when it is 12:10pm in boston ET? Should it show all records with a date after 12:10 or all records after 17:10?
Whether something is a local date or not is irrelevant in this case. Note that there is no UTC variant of the [%CurrentDateTime%] token because this wouldn't make any sense, a moment in time is the same everywhere in the world, even if it may be displayed differently depending on the place. To answer the question, this is yes to both. It will show all records after 12:10 EST (for the localized dates) which is the same as 17:10 UTC (which is how your non-localized dates would show), but these times are the same.