diff --git a/httpobscli/cli.py b/httpobscli/cli.py index 0a2a9d3..d65a06b 100755 --- a/httpobscli/cli.py +++ b/httpobscli/cli.py @@ -8,6 +8,7 @@ from sys import exit import argparse import datetime +import pytz import json import requests import sys @@ -61,7 +62,13 @@ def analyze(host): # Print out a notification on stderr that it's a cached result # I hate working with datetime so much - differential = datetime.datetime.now() - datetime.datetime.strptime(scan['end_time'], '%a, %d %b %Y %H:%M:%S %Z') + differential = datetime.datetime.now(pytz.utc) - \ + pytz.timezone('GMT').localize( + datetime.datetime.strptime( + scan['end_time'], + '%a, %d %b %Y %H:%M:%S %Z' + ) + ) differential = differential.days * 86400 + differential.seconds if differential > 300: diff --git a/requirements.txt b/requirements.txt index f229360..c552f88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ requests +pytz diff --git a/setup.py b/setup.py index f228d83..a97b602 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,8 @@ setup( license='MPL 2.0', long_description=README, install_requires=[ - 'requests' + 'requests', + 'pytz' ], classifiers=[ 'Development Status :: 4 - Beta',