Use time() instead of creating a temporary time object

This commit is contained in:
Matthias 2024-04-26 20:24:54 +02:00
parent 9bc866e6b2
commit dd04c51c42

View File

@ -1,5 +1,6 @@
import re
from datetime import datetime, timezone
from time import time
from typing import Optional, Union
import humanize
@ -25,7 +26,7 @@ def dt_ts(dt: Optional[datetime] = None) -> int:
"""
if dt:
return int(dt.timestamp() * 1000)
return int(dt_now().timestamp() * 1000)
return int(time() * 1000)
def dt_ts_def(dt: Optional[datetime], default: int = 0) -> int: