Update app.py
Browse files
app.py
CHANGED
@@ -451,26 +451,37 @@ def table():
|
|
451 |
|
452 |
@app.route('/online_api', methods=['GET'])
|
453 |
def online_api():
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
|
475 |
|
476 |
|
|
|
451 |
|
452 |
@app.route('/online_api', methods=['GET'])
|
453 |
def online_api():
|
454 |
+
# Устанавливаем московское время (UTC+3)
|
455 |
+
moscow_tz = pytz.timezone("Europe/Moscow")
|
456 |
+
current_time = datetime.now(moscow_tz)
|
457 |
+
|
458 |
+
# Форматируем дату и время отдельно
|
459 |
+
date = current_time.strftime('%Y-%m-%d') # Например, "2025-03-23"
|
460 |
+
time = current_time.strftime('%H:%M:%S') # Например, "14:35:42"
|
461 |
+
|
462 |
+
return jsonify(
|
463 |
+
dey=globs.dey,
|
464 |
+
wek=globs.wek,
|
465 |
+
v_hid=globs.v_hid,
|
466 |
+
v_min=globs.v_min,
|
467 |
+
ph=globs.ph,
|
468 |
+
ec=globs.ec,
|
469 |
+
tS=globs.tS,
|
470 |
+
tA=globs.tA,
|
471 |
+
hDm=globs.hDm,
|
472 |
+
sVen=globs.sVen,
|
473 |
+
rFul=globs.rFul,
|
474 |
+
rLi=globs.rLi,
|
475 |
+
rWat=globs.rWat,
|
476 |
+
rRas=globs.rRas,
|
477 |
+
rPH=globs.rPH,
|
478 |
+
rEC=globs.rEC,
|
479 |
+
rSl=globs.rSl,
|
480 |
+
rLe=globs.rLe,
|
481 |
+
alW=globs.alW,
|
482 |
+
date=date, # Добавляем дату
|
483 |
+
time=time # Добавляем время
|
484 |
+
)
|
485 |
|
486 |
|
487 |
|