From e87e6294c809e35c46d38694e7c4112723657665 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sun, 21 Mar 2010 11:40:32 +0000 Subject: [PATCH] return time in filter dates, adjusted using day_start from general config, update playerstats to use this --- pyfpdb/Filters.py | 5 +++-- pyfpdb/SQL.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index 4603e6e4..15fccd1c 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -884,12 +884,13 @@ class Filters(threading.Thread): s2 = strptime(t2, "%Y-%m-%d") e1 = mktime(s1) + offset # s1 is localtime, but returned time since epoch is UTC, then add the e2 = mktime(s2) + offset # s2 is localtime, but returned time since epoch is UTC + e2 = e2 + 24 * 3600 - 1 # date test is inclusive, so add 23h 59m 59s to e2 adj_t1 = strftime("%Y-%m-%d %H:%M:%S", gmtime(e1)) # make adjusted string including time - adj_t1 = strftime("%Y-%m-%d %H:%M:%S", gmtime(e1)) + adj_t2 = strftime("%Y-%m-%d %H:%M:%S", gmtime(e2)) log.info("t1="+t1+" adj_t1="+adj_t1+'.') - return (t1, t2) + return (adj_t1, adj_t2) def __get_date(self, widget, calendar, entry, win): # year and day are correct, month is 0..11 diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index d844b802..deb9d527 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -1921,7 +1921,7 @@ class Sql: and h.seats - and date_format(h.handStart, '%Y-%m-%d') + and date_format(h.handStart, '%Y-%m-%d %T') group by hgameTypeId ,pname ,gt.base @@ -2006,7 +2006,7 @@ class Sql: and h.seats - and to_char(h.handStart, 'YYYY-MM-DD') + and to_char(h.handStart, 'YYYY-MM-DD HH24:MI:SS') group by hgameTypeId ,pname ,gt.base @@ -2092,7 +2092,7 @@ class Sql: and h.seats - and date(h.handStart) + and datetime(h.handStart) group by hgameTypeId ,hp.playerId ,gt.base