~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/browser/launchpad.py

  • Committer: Jonathan Lange
  • Date: 2011-06-30 11:28:59 UTC
  • mto: This revision was merged to the branch mainline in revision 13368.
  • Revision ID: jml@canonical.com-20110630112859-t6d7fh88azd6xuwp
Use the new utc_now()

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
import cgi
26
26
from datetime import (
27
 
    datetime,
28
27
    timedelta,
29
28
    )
30
29
import operator
43
42
from zope.datetime import (
44
43
    DateTimeError,
45
44
    parseDatetimetz,
46
 
    tzinfo,
47
45
    )
48
46
from zope.i18nmessageid import Message
49
47
from zope.interface import implements
143
141
from lp.registry.interfaces.projectgroup import IProjectGroupSet
144
142
from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
145
143
from lp.services.propertycache import cachedproperty
 
144
from lp.services.utils import utc_now
146
145
from lp.services.worlddata.interfaces.country import ICountrySet
147
146
from lp.services.worlddata.interfaces.language import ILanguageSet
148
147
from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet
374
373
            except DateTimeError:
375
374
                # XXX SteveAlexander 2005-09-22: log a warning here.
376
375
                return ''
377
 
            nowtz = datetime.utcnow().replace(tzinfo=tzinfo(0))
378
 
            timeleft = maintenancetime - nowtz
 
376
            timeleft = maintenancetime - utc_now()
379
377
            if timeleft > self.toomuchtime:
380
378
                return ''
381
379
            elif timeleft < self.notmuchtime: