publish_timestamp Windows 7 Fix

On Windows 7 datetime.datetime.fromtimestamp(int(0)) returns a date before 1970, which causes the script to crash. This fixes the bug.
pull/63/head
Nick Driver 2017-03-14 11:07:31 -04:00 committed by GitHub
parent a7e66ca5db
commit 4aa0df9d1f
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ class MISPEvent(object):
if kwargs.get('locked'):
self.locked = kwargs['locked']
if kwargs.get('publish_timestamp'):
self.publish_timestamp = datetime.datetime.fromtimestamp(int(kwargs['publish_timestamp']))
self.publish_timestamp = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=int(kwargs['publish_timestamp']))
if kwargs.get('sharing_group_id'):
self.sharing_group_id = int(kwargs['sharing_group_id'])
if kwargs.get('Org'):