[tor-commits] [sbws/master] Add function to obtain current unix timestamp
juga at torproject.org
juga at torproject.org
Tue Sep 18 09:26:12 UTC 2018
commit 953e502271f7373c7476fade92f9464e5bdb4e3b
Author: juga0 <juga at riseup.net>
Date: Wed Sep 5 12:12:54 2018 +0000
Add function to obtain current unix timestamp
---
sbws/util/timestamp.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sbws/util/timestamp.py b/sbws/util/timestamp.py
index d4629a3..eca78c5 100644
--- a/sbws/util/timestamp.py
+++ b/sbws/util/timestamp.py
@@ -42,6 +42,10 @@ def unixts_to_isodt_str(unixts):
return dt_obj_to_isodt_str(unixts_to_dt_obj(unixts))
+def now_unixts():
+ return datetime.utcnow().timestamp()
+
+
def now_isodt_str():
"""Return datetime now as ISO 8601 string in UTC time zone."""
return dt_obj_to_isodt_str(datetime.utcnow())
More information about the tor-commits
mailing list