Query date intervals by their numeric epoch time.

SQLite store dates as epoch time offsets in UTC. By converting date
interval endpoints to UTC epoch time in Python, using the SQLite date
functions isn't necessary any more.
This commit is contained in:
Stig Inge Lea Bjørnsen 2014-02-19 20:50:13 +01:00
parent cf0a10b652
commit d65f2b8095

View file

@ -461,7 +461,7 @@ class DateQuery(FieldQuery):
date = datetime.utcfromtimestamp(timestamp)
return self.interval.contains(date)
_clause_tmpl = "datetime({0}, 'unixepoch') {1} datetime(?, 'unixepoch')"
_clause_tmpl = "{0} {1} ?"
def col_clause(self):
clause_parts = []