Skip to content

Commit

Permalink
Comment ISO 8601 timestamp generator
Browse files Browse the repository at this point in the history
* Comment ISO 8601 timestamp generator
* Comment new function to add space between time and TZ offset
  • Loading branch information
Mark Bonsack committed Feb 13, 2020
1 parent 3f7cc46 commit d7b4abd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_cisco_acs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
def test_cisco_acs_single(record_property, setup_wordlist, setup_splunk, setup_sc4s):
host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist))

# Generate an ISO 8601 compliant timestamp with local timezone offset (2020-02-12 12:46:39.323-08:00)
dt = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone().isoformat(sep=' ', timespec='milliseconds')

# Function to insert a space between the time and TZ offset (2020-02-12 12:46:39.323 -08:00)
def insert_space(string, integer):
return string[0:integer] + ' ' + string[integer:]

Expand All @@ -40,8 +42,10 @@ def insert_space(string, integer):
def test_cisco_acs_multi(record_property, setup_wordlist, setup_splunk, setup_sc4s):
host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist))

# Generate an ISO 8601 compliant timestamp with local timezone offset (2020-02-12 12:46:39.323-08:00)
dt = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone().isoformat(sep=' ', timespec='milliseconds')

# Function to insert a space between the time and TZ offset (2020-02-12 12:46:39.323 -08:00)
def insert_space(string, integer):
return string[0:integer] + ' ' + string[integer:]

Expand Down

0 comments on commit d7b4abd

Please sign in to comment.