From 8c212e0d71b1c4ea7ee3214aef4cfc4c5866c71d Mon Sep 17 00:00:00 2001 From: Luiz Costa Date: Wed, 5 Jun 2024 11:26:48 +0100 Subject: [PATCH] datetime format fix --- msp_remoteadmin/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msp_remoteadmin/tools.py b/msp_remoteadmin/tools.py index 21e4af0..3d0bd85 100644 --- a/msp_remoteadmin/tools.py +++ b/msp_remoteadmin/tools.py @@ -19,7 +19,7 @@ def log_start_session(session_id, start_time): doc = frappe.get_doc({ "doctype": "Remote Connection Sessions", "id": session_id, - "start_datetime": datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S") + "start_datetime": datetime.strptime(start_time, "%Y-%m-%dT%H:%M:%S.%f") }) doc.insert() frappe.db.commit() @@ -41,7 +41,7 @@ def log_end_session(session_id, end_time): ) if active_session: doc = frappe.get_doc("Remote Connection Sessions", active_session[0]["name"]) - doc.end_datetime = datetime.strptime(end_time, "%Y-%m-%d %H:%M:%S") + doc.end_datetime = datetime.strptime(end_time, "%Y-%m-%dT%H:%M:%S.%f") doc.save() frappe.db.commit() frappe.logger().info(f"Session {session_id} ended and updated in Frappe")