yf_yzl 2 лет назад
Родитель
Сommit
06797435fd
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      smartfarming/views/device.py

+ 2 - 1
smartfarming/views/device.py

@@ -231,7 +231,8 @@ class QxzDeviceAddAPIViw(APIView):
                                         if result:
                                             result_tp = f"{zh_k[0]}{result}{zh_k[1]},"
                                             result_tp_fin += result_tp
-                uptime_tp = int((datetime.datetime.strptime(uptime, "%Y-%m-%d %H: %M: %S")).timestamp())
+                up = uptime.replace(" ", "")
+                uptime_tp = int((datetime.datetime.strptime(up, "%Y-%m-%d%H:%M:%S")).timestamp())
                 if result_tp_fin:
                     alarm_new = MongoQXZ_Alarm_Log_New()
                     alarm_new.warning_content = result_tp_fin