Timzone out with 2 hours inside mendix

When I create any object [entity] with a form inside mendix, the createdDate is 2 hours in the past as opposed to now. The server's datetime is correct & the timezone is gmt +2. Now, does this mean that I need to set the timezone in Mendix server or the SQL database where the object exists. The SQL DB is on a different machine than the Mendix server.
2 answers

The built-in createdDate and changedDate fields in Mendix entities cannot be localized and are always displayed in UTC/GMT. If you wish to display dates in your local timezone you must create your own date/time attributes and set them to use localized time. You can use a before create microflow to set the current date/time to your own field.


Set the Localize to 'No' on your type date time in your attribute.