[sbws/master] Add function to obtain current unix timestamp

18 Sep
2018
18 Sep
'18
9:26 a.m.
commit 953e502271f7373c7476fade92f9464e5bdb4e3b Author: juga0 <juga@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())
2480
Age (days ago)
2480
Last active (days ago)
0 comments
1 participants
participants (1)
-
juga@torproject.org