From 67d103a2936e18d9cce9e94ec1ac4d56a627dc6b Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 11 Jan 2019 05:19:07 -0500 Subject: [PATCH] dont float round timestamps --- archivebox/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archivebox/util.py b/archivebox/util.py index ac2f7c11..681218fe 100644 --- a/archivebox/util.py +++ b/archivebox/util.py @@ -5,6 +5,7 @@ import time import json import urllib.request +from decimal import Decimal from urllib.parse import quote from datetime import datetime from subprocess import run, PIPE, DEVNULL @@ -491,7 +492,7 @@ def derived_link_info(link): link_info = { **link, - 'date': datetime.fromtimestamp(float(link['timestamp'])).strftime('%Y-%m-%d %H:%M'), + 'date': datetime.fromtimestamp(Decimal(link['timestamp'])).strftime('%Y-%m-%d %H:%M'), 'google_favicon_url': 'https://www.google.com/s2/favicons?domain={domain}'.format(**link), 'favicon_url': 'archive/{timestamp}/favicon.ico'.format(**link), 'files_url': 'archive/{timestamp}/index.html'.format(**link),