diff options
| author | 2019-11-15 12:13:16 +0000 | |
|---|---|---|
| committer | 2019-11-15 12:13:16 +0000 | |
| commit | 2cb55306c3155a317223a500f814259e77445325 (patch) | |
| tree | 841f71805d826103b506ea3ed21d492177e9d231 /src/utils | |
| parent | implement opt-in shlex for command args (diff) | |
| signature | ||
show first-words datestamp on !words output
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 477d8e59..33ad449b 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -18,6 +18,9 @@ DATE_HUMAN = "%Y-%m-%d" def datetime_utcnow() -> datetime.datetime: return datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) +def datetime_timestamp(seconds: float) -> datetime.datetime: + return datetime.datetime.fromtimestamp(seconds).replace( + tzinfo=datetime.timezone.utc) def iso8601_format(dt: datetime.datetime, milliseconds: bool=False) -> str: dt_format = dt.strftime(ISO8601_FORMAT_DT) |
