Cyril Jaquier 2005-07-22 21:10:29 +00:00
parent 5dbed848bc
commit bbfc65f569
1 changed files with 6 additions and 0 deletions

View File

@ -186,6 +186,12 @@ class LogReader:
"""
date = list(time.strptime(value, self.timepattern))
if date[0] < 2000:
# There is probably no year field in the logs
date[0] = time.gmtime()[0]
# Bug fix for #1241756
# If the date is greater than the current time, we suppose
# that the log is not from this year but from the year before
if date > time.time():
date[0] -= 1
unixTime = time.mktime(date)
return unixTime