From c20175fce642bd7300dd22843ea5d6a81a037117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 10 Apr 2018 14:01:07 +0200 Subject: [PATCH] chg: default timestamp for a parsed IP is today midnight --- bgpranking/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpranking/parser.py b/bgpranking/parser.py index 15c2cf1..6f19da7 100644 --- a/bgpranking/parser.py +++ b/bgpranking/parser.py @@ -51,7 +51,8 @@ class RawFilesParser(): return ['.'.join(str(int(part)) for part in ip.split(b'.')).encode() for ip in ips] def parse_raw_file(self, f: BytesIO): - self.datetime = datetime.now() + # If the list doesn't provide a time, fallback to current day, midnight + self.datetime = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) return self.extract_ipv4(f.getvalue()) def parse_raw_files(self):