From cc78cfeeaad1786331ae32e695a963c03b01c82b Mon Sep 17 00:00:00 2001 From: Paul Biester Date: Mon, 6 Oct 2014 21:47:59 +0200 Subject: [PATCH] Fix for problem with the starting point of the time substring --- apache_log_parser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache_log_parser/__init__.py b/apache_log_parser/__init__.py index 0d1249e..8d17407 100644 --- a/apache_log_parser/__init__.py +++ b/apache_log_parser/__init__.py @@ -67,7 +67,7 @@ def apachetime(s): """ month_map = {'Jan': 1, 'Feb': 2, 'Mar':3, 'Apr':4, 'May':5, 'Jun':6, 'Jul':7, 'Aug':8, 'Sep': 9, 'Oct':10, 'Nov': 11, 'Dec': 12} - s = s[1:-1] + s = s[s.find('[')+1:-1] return datetime(int(s[7:11]), month_map[s[3:6]], int(s[0:2]), \ int(s[12:14]), int(s[15:17]), int(s[18:20]))