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/hostels/hostel.py

    r7811 r8183  
    2121import grok
    2222from zope.event import notify
     23from zope.component import getUtility
    2324from datetime import datetime
    2425from waeup.kofa.utils.helpers import attrs_to_fields
     
    2627from waeup.kofa.hostels.interfaces import IHostel, IBed, IBedAllocateStudent
    2728from waeup.kofa.students.interfaces import IBedTicket
     29from waeup.kofa.interfaces import IKofaUtils
    2830from waeup.kofa.interfaces import MessageFactory as _
    2931
     
    204206                return '%s without bed ticket' % old_owner
    205207            bedticket.bed = None
    206             timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
     208            tz = getUtility(IKofaUtils).tzinfo
     209            timestamp = datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
    207210            bedticket.bed_coordinates = u'-- booking cancelled on %s --' % timestamp
    208211            return old_owner
Note: See TracChangeset for help on using the changeset viewer.