Skip to content

Commit

Permalink
fix: Fix python2.7 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Dec 20, 2017
1 parent 78c156b commit 994afea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pymisp/mispevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def _datetime_to_timestamp(d):
if sys.version_info >= (3, 3):
return d.timestamp()
else:
from datetime import timezone # Only for Python < 3.3
return (d - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
return (d - datetime.utcfromtimestamp(0)).total_seconds()


class MISPAttribute(AbstractMISP):
Expand Down

0 comments on commit 994afea

Please sign in to comment.