From 8026ba256a1b29f6f7e66724098a0e5e6c8c0d63 Mon Sep 17 00:00:00 2001 From: Chaz Date: Wed, 24 Nov 2010 14:41:12 -0600 Subject: [PATCH] It's %H, not %h --- pyfpdb/Database.py | 2 +- pyfpdb/SQL.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index e5cdfa6b..f2ce36b5 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1827,7 +1827,7 @@ class Database: """Update cached statistics. If update fails because no record exists, do an insert.""" if self.use_date_in_hudcache: - styleKey = datetime.strftime(starttime, 'd%y%m%d%h') + styleKey = datetime.strftime(starttime, 'd%y%m%d%H') #styleKey = "d%02d%02d%02d%02d" % (hand_start_time.year-2000, hand_start_time.month, hand_start_time.day, hand_start_time.hour) else: # hard-code styleKey as 'A00000000' (all-time cache, no key) for now diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 560930c3..ffe1ee6d 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2047,7 +2047,7 @@ class Sql: # gets a date, would need to use handsplayers (not hudcache) to get exact hand Id if db_server == 'mysql': self.query['get_date_nhands_ago'] = """ - select concat( 'd', date_format(max(h.startTime), '%Y%m%d%h') ) + select concat( 'd', date_format(max(h.startTime), '%Y%m%d%H') ) from (select hp.playerId ,coalesce(greatest(max(hp.handId)-%s,1),1) as maxminusx from HandsPlayers hp @@ -3290,7 +3290,7 @@ class Sql: else 'E' end AS hc_position - ,date_format(h.startTime, 'd%y%m%d%h') + ,date_format(h.startTime, 'd%y%m%d%H') ,count(1) ,sum(wonWhenSeenStreet1) ,sum(wonWhenSeenStreet2) @@ -3379,7 +3379,7 @@ class Sql: ,h.seats ,hc_position - ,date_format(h.startTime, 'd%y%m%d%h') + ,date_format(h.startTime, 'd%y%m%d%H') """ elif db_server == 'postgresql': self.query['rebuildHudCache'] = """ @@ -3686,7 +3686,7 @@ class Sql: else 'E' end AS hc_position - ,'d' || substr(strftime('%Y%m%d%h', h.startTime),3,7) + ,'d' || substr(strftime('%Y%m%d%H', h.startTime),3,7) ,count(1) ,sum(wonWhenSeenStreet1) ,sum(wonWhenSeenStreet2) @@ -3775,7 +3775,7 @@ class Sql: ,h.seats ,hc_position - ,'d' || substr(strftime('%Y%m%d%h', h.startTime),3,7) + ,'d' || substr(strftime('%Y%m%d%H', h.startTime),3,7) """ self.query['insert_hudcache'] = """