I package my python (flask
) application with docker. Within my app I'm generating UTC date with datetime
library using datetime.utcnow()
.
Unfortunately, when I inspect saved data with MongoDB Compass
the UTC date is offset two hours (to my local time zone). All my docker containers have time zone set to Etc/UTC
. Morover, mongoengine
connection to MongoDB uses tz_aware=False
and tzinfo=None
, what prevents on fly date conversions.
Where does the offset come from and how to fix it?