I have recently run into an interesting mismatch between development environment and production environment. I am using meteor-up with zodern/meteor:latest to deploy to a local server. Even though both the development and production environment are running linux with timezone CET +0100, they do not agree on the timezone to use for dates in the MongoDB shell and the node process: the production environment shows UTC times in both (for instance using Date() in npx mup mongo shell) while the development environment uses the correct timezone. Note that on the server, it is only the production environment that causes problem (some docker containers fired by meteor-up), trying Date() in node or meteor node does yield the correct zoned dates. This leads to issues in some date computations using date-fns.
I’d like to have both environments to behave the same. Any idea what’s the correct way to approach this problem? @zodern
PS: To workaround the specific symptoms I am witnessing, I think I will leverage date-fns-tz.
PPS: I ended up implementing my own hack on top of Intl.DateTimeFormat instead.