Dates --> trimToDays on same day +0200 difference

Hi,    I trying to get a microflow to select rows where the dates are the same. I create a variable: $CurrentDate = trimToDays([%CurrentDateTime%]) in the microflow where the selection takes place. It searches [LicenseValidUntil =$CurrentDate] and the licenseValidUntil is created somewere else in the app with this LicenseValidUntil= trimToDays([%CurrentDateTime%]) So exactly the same, however:  LicenseValidUntil UTC time: 2020-06-22 22:00:00.000 Session time: 2020-06-23 00:00:00.000 +0200 CurrentDate UTC time: 2020-06-23 00:00:00.000 Session time: 2020-06-23 00:00:00.000 +0000   So they obviously does not match…   Any ideas? Thanks
2 answers


It seems like LicenseValidUntil attribute is Localized.  In cases where the time doesn’t matter (like this one) you should turn off localization.  This will make future date calculations and comparisons easier.  It will also change the way dates are captured in the database so you won’t have the time zone offset you have in this case.



One correction:  Turning off localize doesn’t change the way dates are stored in the database.  Dates are always stored as UTC time.  It will change how dates are handled in microflows and pages.  The time zone of the user will no longer be used to localize dates with localize turned off.


Hi Jeremie,

Is it just the dates that need to match, so the time is not important?


If that is the case you can format the date to just be that: only the date, without time and then parse it back to a date again.