diff --git a/system_status/server.py b/system_status/server.py index 49a24c5..d5493d4 100644 --- a/system_status/server.py +++ b/system_status/server.py @@ -125,7 +125,10 @@ def get_prometheus_data() -> list[PrometheusData]: timestamps_and_values = [] for epoch_time, value in maybe_values: - timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(epoch_time)) + utc_dt = datetime.datetime.fromtimestamp(epoch_time, datetime.timezone.utc) + pst_tz = ZoneInfo("America/Los_Angeles") + pst_dt = utc_dt.astimezone(pst_tz) + timestamp = pst_dt.strftime("%Y-%m-%d %H:%M:%S %Z") timestamps_and_values.append(TimestampAndValuePair(timestamp, value)) # the service is up if the maximum timestamp's value is "1" diff --git a/system_status/templates/my_template.html b/system_status/templates/my_template.html index 44a2049..e0d7a19 100644 --- a/system_status/templates/my_template.html +++ b/system_status/templates/my_template.html @@ -122,11 +122,13 @@