Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Dan Lavu <dlavu@redhat.com>
from __future__ import annotations
+import datetime
from typing import Any
:rtype: list[str]
"""
return [str(x) for x in to_list(value)]
+
+
+def days_since_epoch():
+ """
+ Gets the current date and returns the number of days since 1970-01-01 UTC, this time is also referred to as the
+ Unix epoch.
+ """
+ epoch = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)
+ now_utc = datetime.datetime.now(datetime.timezone.utc)
+ delta = now_utc - epoch
+ return delta.days