mirror of https://github.com/fail2ban/fail2ban
strptime bug fix: if gmtoff is None we have 1 hour increment of time (through utctimetuple), compare:
>>>> datetime.datetime.fromtimestamp(time.mktime(datetime.datetime.now().timetuple())).strftime("%Y-%m-%d %H:%M:%S") '2014-04-29 17:26:31' >>>> datetime.datetime.fromtimestamp(time.mktime(datetime.datetime.now().utctimetuple())).strftime("%Y-%m-%d %H:%M:%S") '2014-04-29 18:26:37'pull/721/head
parent
2526dbae92
commit
2bf0b4a50c
|
@ -190,5 +190,5 @@ def reGroupDictStrptime(found_dict):
|
||||||
if gmtoff is not None:
|
if gmtoff is not None:
|
||||||
return calendar.timegm(date_result.utctimetuple())
|
return calendar.timegm(date_result.utctimetuple())
|
||||||
else:
|
else:
|
||||||
return time.mktime(date_result.utctimetuple())
|
return time.mktime(date_result.timetuple())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue