DmitrMakeev commited on
Commit
7b09368
·
verified ·
1 Parent(s): 04e544a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -20
app.py CHANGED
@@ -451,26 +451,37 @@ def table():
451
 
452
  @app.route('/online_api', methods=['GET'])
453
  def online_api():
454
- return jsonify(dey=globs.dey,
455
- wek=globs.wek,
456
- v_hid=globs.v_hid,
457
- v_min=globs.v_min,
458
- ph=globs.ph,
459
- ec=globs.ec,
460
- tS=globs.tS,
461
- tA=globs.tA,
462
- hDm=globs.hDm,
463
- sVen=globs.sVen,
464
- rFul=globs.rFul,
465
- rLi=globs.rLi,
466
- rWat=globs.rWat,
467
- rRas=globs.rRas,
468
- rPH=globs.rPH,
469
- rEC=globs.rEC,
470
- rSl=globs.rSl,
471
- rLe=globs.rLe,
472
- alW=globs.alW
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