From 020468316b63e59e2de2298602977dc813be4af0 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Thu, 20 Feb 2020 17:25:54 -0800 Subject: [PATCH] Update epoch string generation comment * Update epoch string generation comment --- tests/test_cisco_acs.py | 2 +- tests/test_fortinet_ngfw.py | 2 +- tests/test_fortinet_web.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_cisco_acs.py b/tests/test_cisco_acs.py index 19cf8b9..a26e19d 100644 --- a/tests/test_cisco_acs.py +++ b/tests/test_cisco_acs.py @@ -43,7 +43,7 @@ def time_operations(dt): # epoch = dt.fromtimestamp(dt.timestamp()).strftime('%s') # Since datetime.now().astimezone() is aware, strftime() should be safe and form below OK - # Trim last 3 digits of microsecond resolution to obtain milliseconds + # Trim last 3 or 7 characters of microsecond resolution to obtain milliseconds or whole seconds, respectively epoch = dt.astimezone().strftime("%s.%f")[:-3] return iso, bsd, time, date, tzoffset, epoch diff --git a/tests/test_fortinet_ngfw.py b/tests/test_fortinet_ngfw.py index 6d63bc7..725934f 100644 --- a/tests/test_fortinet_ngfw.py +++ b/tests/test_fortinet_ngfw.py @@ -48,7 +48,7 @@ def time_operations(dt): # epoch = dt.fromtimestamp(dt.timestamp()).strftime('%s') # Since datetime.now().astimezone() is aware, strftime() should be safe and form below OK - # Trim last 3 digits of microsecond resolution to obtain milliseconds + # Trim last 3 or 7 characters of microsecond resolution to obtain milliseconds or whole seconds, respectively epoch = dt.astimezone().strftime("%s.%f")[:-7] return iso, bsd, time, date, tzoffset, epoch diff --git a/tests/test_fortinet_web.py b/tests/test_fortinet_web.py index abc92b0..f62a298 100644 --- a/tests/test_fortinet_web.py +++ b/tests/test_fortinet_web.py @@ -47,7 +47,7 @@ def time_operations(dt): # epoch = dt.fromtimestamp(dt.timestamp()).strftime('%s') # Since datetime.now().astimezone() is aware, strftime() should be safe and form below OK - # Trim last 3 digits of microsecond resolution to obtain milliseconds + # Trim last 3 or 7 characters of microsecond resolution to obtain milliseconds or whole seconds, respectively epoch = dt.astimezone().strftime("%s.%f")[:-7] return iso, bsd, time, date, tzoffset, epoch