FTP and Timezone fix.

Error reported with the following hand hostory from FTP France:

Full Tilt Poker.fr Game #22632637058: Daily Euro (174599326), Table 3 - 10/20 - No Limit Hold'em - 20:15:39 CET - 2010/07/27

The existing FTP parser crashed on CET times.

1) Fixed parser to accept CET
2) Added timezone offset into HHC

Not happy with TZ1/TZ2 solution.
This commit is contained in:
Worros
2010-07-29 19:59:45 +08:00
parent 0cd5b50b2f
commit ac728fffb2
2 changed files with 21 additions and 12 deletions
+9 -5
View File
@@ -497,19 +497,23 @@ or None if we fail to get the info """
@staticmethod
def changeTimezone(time, givenTimezone, wantedTimezone):
offest = datetime.timedelta(hours=0)
if givenTimezone=="ET" and wantedTimezone=="UTC":
# approximate rules for ET daylight savings time:
if ( time.month == 12 # all of Dec
or (time.month == 11 and time.day > 4) # and most of November
or time.month < 3 # and all of Jan/Feb
or (time.month == 3 and time.day < 11) ): # and 1st 10 days of March
offset = datetime.timedelta(hours=5) # are EST: assume 5 hour offset (ET without daylight saving)
offset = datetime.timedelta(hours=5) # are EST: assume 5 hour offset (ET without daylight saving)
else:
offset = datetime.timedelta(hours=4) # rest is EDT: assume 4 hour offset (ET with daylight saving)
# adjust time into UTC:
time = time + offset
offset = datetime.timedelta(hours=4) # rest is EDT: assume 4 hour offset (ET with daylight saving)
#print " tz = %s start = %s" % (tz, str(hand.starttime))
return time
elif givenTimezone=="CET" and wantedTimezone=="UTC":
offset = datetime.timedelta(hours=1)
# adjust time into UTC:
time = time + offset
return time
#end @staticmethod def changeTimezone
@staticmethod