~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/doc/announcement.txt

  • 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:
11
11
    >>> from zope.component import getUtility
12
12
    >>> from datetime import datetime, timedelta
13
13
    >>> import pytz
14
 
    >>> NOW = datetime.utcnow().replace(tzinfo=pytz.utc)
 
14
    >>> from lp.services.utils import utc_now
 
15
    >>> NOW = utc_now()
15
16
    >>> FUTURE = NOW + timedelta(days=10)
16
17
    >>> from lp.registry.interfaces.announcement import IAnnouncementSet
17
18
    >>> from lp.registry.interfaces.distribution import IDistributionSet
49
50
In this first example, we will specify a date and time the announcement was
50
51
published:
51
52
 
52
 
    >>> from datetime import datetime
53
 
    >>> import pytz
54
53
    >>> apache_asia = apache.announce(
55
54
    ...  mark,
56
55
    ...  "OS Summit Asia 2007 - New Event by Apache and Eclipse",