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

Date & time handling is brittle #59

Closed
zenhack opened this Issue Apr 8, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@zenhack
Copy link
Owner

zenhack commented Apr 8, 2016

The vast majority of bugs (esp. critical ones) have been related to handling dates and times. We ought to find a way to make this more robust. things like to_dbtime() and set_tz() have improved the situation a bit, but it's easy to forget to call them (I just caught a bunch of missing calls to dst_adjust()).

My take would be to strengthen the types; we should get a loud error when mixing duedates and publication dates. We also need to do something about localtime vs utc and marshalling in and out of the database.

SQLAlchemy's TypeDecorator would allow us to customize the marshalling, so we'd have to worry about one less thing there. I think we can get away with just two types: DueDate and PublicationDate. We should basically avoid doing anything with other date types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment