avoiding common pitfalls of datetime from a webapp's perspective
TRANSCRIPT
- 1. Avoiding common pitfalls of datetime from a webapp's perspective PyCon India - 2015 Indradhanush Gupta
- 2. About me Love Python + Emacs ZeroMQ, Twisted, Django Graduated in 2014 Software Engineer @ Instamojo
- 3. Target Audience Beginner in Python Web developer And anyone else!
- 4. import datetime Naive vs Aware Datetime storage in Postgres Should I ever use a naive datetime object?
- 5. import pytz Adding timezone info to naive datetime Converting datetime to another timezone Do not use datetime.datetime.replace
- 6. import production Examples from real life and experience.
- 7. import production 10 AM for the user != 10 AM in your DB
- 8. import freezegun Writing tests that need to mock datetime Using freezegun instead of mock Examples
- 9. import extras timedelta dateutil.relativedelta dateutil.parser
- 10. import questions
- 11. Thank You!