mirror of
https://github.com/mvt-project/mvt.git
synced 2024-06-30 16:18:54 +00:00
Fixing unix epoch timestamps conversion to float
This commit is contained in:
parent
66a157868f
commit
f438f7b1fb
|
@ -37,7 +37,7 @@ def convert_datetime_to_iso(datetime: datetime.datetime) -> str:
|
|||
return ""
|
||||
|
||||
|
||||
def convert_unix_to_utc_datetime(timestamp: int) -> datetime.datetime:
|
||||
def convert_unix_to_utc_datetime(timestamp: Union[int, float, str]) -> datetime.datetime:
|
||||
"""Converts a unix epoch timestamp to UTC datetime.
|
||||
|
||||
:param timestamp: Epoc timestamp to convert.
|
||||
|
@ -45,7 +45,7 @@ def convert_unix_to_utc_datetime(timestamp: int) -> datetime.datetime:
|
|||
:returns: datetime.
|
||||
|
||||
"""
|
||||
return datetime.datetime.utcfromtimestamp(int(timestamp))
|
||||
return datetime.datetime.utcfromtimestamp(float(timestamp))
|
||||
|
||||
|
||||
def convert_unix_to_iso(timestamp: int) -> str:
|
||||
|
|
Loading…
Reference in New Issue
Block a user