HumanDynamics / openbadge

MIT License
49 stars 19 forks source link

Better TZ handling in Python code #24

Closed OrenLederman closed 7 years ago

OrenLederman commented 8 years ago

Currently, the badge expects (and returns) UTC time. However, the server code saves the datetime in local time, without time zone information.

While the code converts to and from UTC, it is better to use pytz (and tzlocal), and save the time zone as part of the date. Or, alternatively, save all dates in UTC

https://julien.danjou.info/blog/2015/python-and-timezones

http://stackoverflow.com/questions/13218506/how-to-get-system-timezone-setting-and-pass-it-to-pytz-timezone