Update app.py
Browse files
app.py
CHANGED
@@ -80,8 +80,9 @@ def save_data_to_db(db_name, data):
|
|
80 |
conn = sqlite3.connect(db_name)
|
81 |
cursor = conn.cursor()
|
82 |
|
83 |
-
#
|
84 |
-
|
|
|
85 |
|
86 |
# Вставляем данные в таблицу
|
87 |
cursor.execute('''
|
@@ -89,7 +90,7 @@ def save_data_to_db(db_name, data):
|
|
89 |
date_time, dey, wek, v_hid, v_min, ph, ec, tS, tA, hDm, sVen, onA, onB, onC
|
90 |
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
91 |
''', (
|
92 |
-
current_time, # Дата и время
|
93 |
data['dey'], data['wek'], data['v_hid'], data['v_min'], data['ph'], data['ec'],
|
94 |
data['tS'], data['tA'], data['hDm'], data['sVen'], data['onA'], data['onB'],
|
95 |
data['onC']
|
|
|
80 |
conn = sqlite3.connect(db_name)
|
81 |
cursor = conn.cursor()
|
82 |
|
83 |
+
# ✅ Устанавливаем московское время (UTC+3)
|
84 |
+
moscow_tz = pytz.timezone("Europe/Moscow")
|
85 |
+
current_time = datetime.now(moscow_tz).strftime('%Y-%m-%d %H:%M:%S')
|
86 |
|
87 |
# Вставляем данные в таблицу
|
88 |
cursor.execute('''
|
|
|
90 |
date_time, dey, wek, v_hid, v_min, ph, ec, tS, tA, hDm, sVen, onA, onB, onC
|
91 |
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
92 |
''', (
|
93 |
+
current_time, # ✅ Дата и время по Москве
|
94 |
data['dey'], data['wek'], data['v_hid'], data['v_min'], data['ph'], data['ec'],
|
95 |
data['tS'], data['tA'], data['hDm'], data['sVen'], data['onA'], data['onB'],
|
96 |
data['onC']
|