diff --git a/voussoirkit/timetools.py b/voussoirkit/timetools.py index a0c9bef..42abb5b 100644 --- a/voussoirkit/timetools.py +++ b/voussoirkit/timetools.py @@ -5,3 +5,9 @@ def now(): def now_local(): return datetime.datetime.now().astimezone() + +def fromtimestamp(unix): + return datetime.datetime.utcfromtimestamp(unix).replace(tzinfo=datetime.timezone.utc) + +def fromtimestamp_local(unix): + return datetime.datetime.fromtimestamp(unix).astimezone()