]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Revert "tests/: implement `days_since_epoch()`"
authorSerge Hallyn <serge@hallyn.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
This reverts commit b56fdc329f3deb26a04e54b9e4729fa8116b6bfc.

tests/system/framework/misc/__init__.py

index 0ee8a080a59b2fdcfeacf6bedc499ce287a2efe8..92e0b76b9865417e2df3771d171aca3e9be2e0ee 100644 (file)
@@ -2,7 +2,6 @@
 
 from __future__ import annotations
 
-import datetime
 from typing import Any
 
 
@@ -41,14 +40,3 @@ def to_list_of_strings(value: Any | list[Any] | None) -> list[str]:
     :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