Skip to content

Commit 0fc4239

Browse files
ui: fixed exporting rules to the clipboard
We were not formatting the "created" date field properly. More info: #1140 (comment) (cherry picked from commit b096e66)
1 parent 496e905 commit 0fc4239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/opensnitch/rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def rule_to_json(self, node, rule_name):
146146
# exclude this field when exporting to json
147147
tempRule = MessageToJson(rule)
148148
jRule = json.loads(tempRule)
149-
jRule['created'] = str(datetime.fromtimestamp(
150-
rule.created).strftime("%Y-%m-%d %H:%M:%S")
149+
jRule['created'] = "{0}Z".format(
150+
datetime.fromtimestamp(rule.created).isoformat(timespec='microseconds')
151151
)
152152
return json.dumps(jRule, indent=" ")
153153
except Exception as e:

0 commit comments

Comments
 (0)