Merge pull request #428 from GOVCERT-LU/fix_make_timestamp

Bug in _make_timestamp
pull/430/head
Raphaël Vinot 2019-07-30 11:45:28 +02:00 committed by GitHub
commit c0eced64f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1703,7 +1703,7 @@ class ExpandedPyMISP(PyMISP):
def _make_timestamp(self, value: DateTypes): def _make_timestamp(self, value: DateTypes):
'''Catch-all method to normalize anything that can be converted to a timestamp''' '''Catch-all method to normalize anything that can be converted to a timestamp'''
if isinstance(value, datetime): if isinstance(value, datetime):
return datetime.timestamp() return value.timestamp()
elif isinstance(value, date): elif isinstance(value, date):
return datetime.combine(value, datetime.max.time()).timestamp() return datetime.combine(value, datetime.max.time()).timestamp()
elif isinstance(value, str): elif isinstance(value, str):