From b0c5189c4bf449264241a9cc784120eccd29c65d Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 14 Feb 2018 11:50:24 +0100 Subject: [PATCH] Fix timezone for footer of printed exports --- src/pretix/plugins/reports/exporters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pretix/plugins/reports/exporters.py b/src/pretix/plugins/reports/exporters.py index d279a9d620..3ca53274bd 100644 --- a/src/pretix/plugins/reports/exporters.py +++ b/src/pretix/plugins/reports/exporters.py @@ -8,7 +8,7 @@ from django.conf import settings from django.contrib.staticfiles import finders from django.db.models import Sum from django.utils.formats import date_format, localize -from django.utils.timezone import now +from django.utils.timezone import get_current_timezone, now from django.utils.translation import pgettext, pgettext_lazy, ugettext as _ from pretix.base.exporter import BaseExporter @@ -94,10 +94,11 @@ class ReportlabExportMixin: def page_footer(self, canvas, doc): from reportlab.lib.units import mm + tz = get_current_timezone() canvas.setFont('OpenSans', 8) canvas.drawString(15 * mm, 10 * mm, _("Page %d") % (doc.page,)) canvas.drawRightString(self.pagesize[0] - 15 * mm, 10 * mm, - _("Created: %s") % now().strftime("%d.%m.%Y %H:%M:%S")) + _("Created: %s") % now().astimezone(tz).strftime("%d.%m.%Y %H:%M:%S")) def page_header(self, canvas, doc): from reportlab.lib.units import mm