From 7e2f4ba09f783bcde33b1137bd52d8737136aba7 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 8 May 2016 21:54:58 +0200 Subject: [PATCH] use py2-style timestamp-retrieval --- tsstats/log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsstats/log.py b/tsstats/log.py index 8af2575..64a931d 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -38,7 +38,8 @@ def parse_logs(log_path, ident_map={}, file_log=False): parts = line.split('|') log_format = '%Y-%m-%d %H:%M:%S.%f' stripped_time = datetime.strptime(parts[0], log_format) - logdatetime = int(stripped_time.timestamp()) + logdatetime = int((stripped_time - datetime(1970, 1, 1)) + .total_seconds()) data = '|'.join(parts[4:]).strip() if data.startswith('client'): nick, clid = re_dis_connect.findall(data)[0]