Skip to content

Properly convert QDateTime from database in Entities

We always store time into the database as UTC, but unfortunately, without timezone, so Qt reads the timestamp and assumes it's local time, so we need to manually correct it.

We already had this handled for retrieveById() but we were not calling the custom conversion function in extractResult().

Note that even if we stored the timestamp with timezone in MySQL or Postgres, Qt cannot handle timezones and would still give us the time as local.

Merge request reports