Ignore:
Timestamp:
16 Apr 2012, 21:07:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Part 2: Consider time zone when creating datetime strings for histories, filenames etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py

    r8159 r8183  
    3232from zope.i18n import translate
    3333from zope.publisher.browser import TestRequest
     34from zope.component import getUtility
    3435from waeup.kofa.browser.interfaces import IPDFCreator
     36from waeup.kofa.interfaces import IKofaUtils
    3537from waeup.kofa.interfaces import MessageFactory as _
    3638
     
    328330        canvas.setFont("Helvetica", 9)
    329331        if not getattr(doc, 'kofa_nodate', False):
    330             today = datetime.now().strftime('%d/%m/%Y %H:%M:%S')
     332            tz = getUtility(IKofaUtils).tzinfo
     333            today = datetime.now(tz).strftime('%d/%m/%Y %H:%M:%S')
    331334            canvas.drawString(2.2*cm, 0.5 * inch,
    332335                translate(_(u'Date: ${a}', mapping = {'a': today})))
Note: See TracChangeset for help on using the changeset viewer.