From c7119662f711e008b71c7981589bf948b919ad20 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Mon, 22 Jan 2024 19:20:13 +0100 Subject: [PATCH] support enable_utc in addition to timezone: let celery handle the timezone to support future changes --- flower/views/tasks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flower/views/tasks.py b/flower/views/tasks.py index 189c0828..88ef078e 100644 --- a/flower/views/tasks.py +++ b/flower/views/tasks.py @@ -1,5 +1,6 @@ import copy import logging +from datetime import datetime from functools import total_ordering from tornado import web @@ -112,9 +113,9 @@ def get(self): app = self.application capp = self.application.capp - time = 'natural-time' if app.options.natural_time else 'time' - if capp.conf.timezone: - time += '-' + str(capp.conf.timezone) + time_type = 'natural-time' if app.options.natural_time else 'time' + tzname = capp.timezone.tzname(datetime.now()) + time = f"{time_type}-{tzname}" self.render( "tasks.html",