From ee926ac9ca84e8c07b72673a2d1c6c5f3c720d38 Mon Sep 17 00:00:00 2001 From: Chaz Date: Wed, 24 Nov 2010 14:18:42 -0600 Subject: [PATCH] * Modified init_hud_stat_vars() so that it uses the timezone & day_start offset from Filters.py --- pyfpdb/Database.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 1fb94cbd..e5cdfa6b 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -55,6 +55,7 @@ import Card import Charset from Exceptions import * import Configuration +import Filters # Other library modules @@ -689,14 +690,16 @@ class Database: else: if row and row[0]: self.hand_1day_ago = int(row[0]) - - d = timedelta(days=hud_days) + + offset = strptime(Filters.Filters(self, self.config, self.sql).getDates()[0],"%Y-%m-%d %H:%M:%S").tm_hour + + d = timedelta(days=hud_days, hours=offset) now = datetime.utcnow() - d - self.date_ndays_ago = "d%02d%02d%02d" % (now.year - 2000, now.month, now.day) + self.date_ndays_ago = "d%02d%02d%02d%02d" % (now.year - 2000, now.month, now.day, offset) - d = timedelta(days=h_hud_days) + d = timedelta(days=h_hud_days, hours=offset) now = datetime.utcnow() - d - self.h_date_ndays_ago = "d%02d%02d%02d" % (now.year - 2000, now.month, now.day) + self.h_date_ndays_ago = "d%02d%02d%02d%02d" % (now.year - 2000, now.month, now.day, offset) def init_player_hud_stat_vars(self, playerid): # not sure if this is workable, to be continued ...