Files
deb-python-sqlalchemy-utils/sqlalchemy_utils
Nick Retallack 3da250d7a3 Fixed ArrowType to store and retrieve time consistently.
SQLAlchemy's handling of time is stupid.  If you hand it a datetime with an explicit time zone set, and attempt to put it in a "timestamp without time zone" field, it will convert it to your local time first.  This is probably not what you want!  Especially in ArrowType case, because when you retrieve the value and pass it to arrow.get, arrow assumes the time is in UTC, when it's really in local time.  This leads to nonsense like this:

myrecord.time = time
db.session.commit()
myrecord.time != time # wtf!  It changed!

In this commit, I make the assumption that you always want to put UTC timestamps into your database, so I convert the incoming time to UTC and then discard the time zone so SQLAlchemy wont mess with it.

A future version of this type might allow you to specify what time zone you want to assume this database column actually represents, so you can convert to and from that time zone when saving and retrieving.
2014-02-13 17:58:36 -08:00
..
2013-12-26 11:29:27 +02:00
2014-01-23 10:07:35 +02:00
2014-01-04 02:43:38 +02:00
2014-02-06 11:12:39 +02:00
2014-01-20 21:30:54 +02:00
2013-09-17 14:07:37 +03:00
2014-01-30 13:21:30 +02:00
2014-01-14 09:33:27 +02:00