From 20dd3e1aec8295369f4f2af671807b9608a1f6d7 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 25 Mar 2009 18:35:19 +0900 Subject: [PATCH] Make CET timezones work with Stars hands --- pyfpdb/PokerStarsToFpdb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 8b905005..f521bbd0 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -128,9 +128,11 @@ follow : whether to tail -f the input""" logging.debug("readHandInfo: %s" % info) for key in info: if key == 'DATETIME': - datetime = info[key].replace(" - "," ") # some are like "2009/02/26 - 15:22:55 ET" - datetime = datetime.replace(" (ET)","") # kludge for now. - datetime = datetime.replace(" ET","") # kludge for now. + #2008/11/12 10:00:48 CET [2008/11/12 4:00:48 ET] + #2008/08/17 - 01:14:43 (ET) + #2008/09/07 06:23:14 ET + m2 = re.search("(?P[0-9]{4})\/(?P[0-9]{2})\/(?P[0-9]{2})[\- ]+(?P[0-9]+):(?P[0-9]+):(?P[0-9]+)", info[key]) + datetime = "%s/%s/%s %s:%s:%s" % (m2.group('Y'), m2.group('M'),m2.group('D'),m2.group('H'),m2.group('MIN'),m2.group('S')) hand.starttime = time.strptime(datetime, "%Y/%m/%d %H:%M:%S") if key == 'HID': hand.handid = info[key]