From 10ae14bb898f4d83d09a4535031f821f7fca4fad Mon Sep 17 00:00:00 2001 From: David Fichtmueller Date: Wed, 8 Nov 2023 12:49:15 +0100 Subject: [PATCH] Switch date formats to ISO 8601 both for the export folder name and the time stamp of the messages in the channel/conversation file. Relevant XKCD: https://xkcd.com/1179/ --- exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter.py b/exporter.py index bb47592..e274de0 100755 --- a/exporter.py +++ b/exporter.py @@ -340,7 +340,7 @@ def parse_channel_history(msgs, users, check_thread=False): usr = {"name": "", "real_name": "none"} timestamp = datetime.fromtimestamp(round(float(msg["ts"]))).strftime( - "%m-%d-%y %H:%M:%S" + "%Y-%m-%d %H:%M:%S" ) text = msg["text"] if msg["text"].strip() != "" else "[no message content]" for u in [x["id"] for x in users]: @@ -484,7 +484,7 @@ if __name__ == "__main__": ) a = parser.parse_args() - ts = str(datetime.strftime(datetime.now(), "%m-%d-%Y_%H%M%S")) + ts = str(datetime.strftime(datetime.now(), "%Y-%m-%d_%H%M%S")) sep_str = "*" * 24 if a.o is None and a.files: