-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong UTC time? #29
Comments
I think you are getting an incorrect timezone, not an incorrect UTC time. Hmm, whenever you deploy your container it will probably be in a datacenter that might be in a different timezone different than yours, so I'm not sure how useful it would be to assume a timezone in your container. It would probably be better to use UTC in your code. Or if you are going to depend on timezones, it should be the timezones of your clients or timezones defined in your settings. For example with things like: from datetime import datetime
now = datetime.utcnow()
print(now) Otherwise, please provide more info and a minimal self-contained example that shows the error. Currently, I have no way of knowing how you are getting those dates, or how to help you debug it. |
Sorry for the late response. Turns out it was an issue with Docker for Windows: |
Cool! Thanks for reporting back and closing the issue 👍 |
Using Windows 10, Docker Desktop
In container:
Thu Feb 13 17:49:33 Vilnius 2020
Google says:
Thu Feb 13 18:49:33 Vilnius 2020
Tried:
apt-get update && apt-get install tzdata
ENV TZ=Europe/Vilnius
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
All other containers that use ubuntu images are OK. This is the first I encountered;
Please help ? I'm not too familiar with docker, and this is quite a problem if you ask me
The text was updated successfully, but these errors were encountered: