METADATA 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. Metadata-Version: 2.0
  2. Name: pytz
  3. Version: 2015.7
  4. Summary: World timezone definitions, modern and historical
  5. Home-page: http://pythonhosted.org/pytz
  6. Author: Stuart Bishop
  7. Author-email: stuart@stuartbishop.net
  8. License: MIT
  9. Download-URL: http://pypi.python.org/pypi/pytz
  10. Keywords: timezone,tzinfo,datetime,olson,time
  11. Platform: Independant
  12. Classifier: Development Status :: 6 - Mature
  13. Classifier: Intended Audience :: Developers
  14. Classifier: License :: OSI Approved :: MIT License
  15. Classifier: Natural Language :: English
  16. Classifier: Operating System :: OS Independent
  17. Classifier: Programming Language :: Python
  18. Classifier: Programming Language :: Python :: 3
  19. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  20. pytz - World Timezone Definitions for Python
  21. ============================================
  22. :Author: Stuart Bishop <stuart@stuartbishop.net>
  23. Introduction
  24. ~~~~~~~~~~~~
  25. pytz brings the Olson tz database into Python. This library allows
  26. accurate and cross platform timezone calculations using Python 2.4
  27. or higher. It also solves the issue of ambiguous times at the end
  28. of daylight saving time, which you can read more about in the Python
  29. Library Reference (``datetime.tzinfo``).
  30. Almost all of the Olson timezones are supported.
  31. .. note::
  32. This library differs from the documented Python API for
  33. tzinfo implementations; if you want to create local wallclock
  34. times you need to use the ``localize()`` method documented in this
  35. document. In addition, if you perform date arithmetic on local
  36. times that cross DST boundaries, the result may be in an incorrect
  37. timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get
  38. 2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A
  39. ``normalize()`` method is provided to correct this. Unfortunately these
  40. issues cannot be resolved without modifying the Python datetime
  41. implementation (see PEP-431).
  42. Installation
  43. ~~~~~~~~~~~~
  44. This package can either be installed from a .egg file using setuptools,
  45. or from the tarball using the standard Python distutils.
  46. If you are installing from a tarball, run the following command as an
  47. administrative user::
  48. python setup.py install
  49. If you are installing using setuptools, you don't even need to download
  50. anything as the latest version will be downloaded for you
  51. from the Python package index::
  52. easy_install --upgrade pytz
  53. If you already have the .egg file, you can use that too::
  54. easy_install pytz-2008g-py2.6.egg
  55. Example & Usage
  56. ~~~~~~~~~~~~~~~
  57. Localized times and date arithmetic
  58. -----------------------------------
  59. >>> from datetime import datetime, timedelta
  60. >>> from pytz import timezone
  61. >>> import pytz
  62. >>> utc = pytz.utc
  63. >>> utc.zone
  64. 'UTC'
  65. >>> eastern = timezone('US/Eastern')
  66. >>> eastern.zone
  67. 'US/Eastern'
  68. >>> amsterdam = timezone('Europe/Amsterdam')
  69. >>> fmt = '%Y-%m-%d %H:%M:%S %Z%z'
  70. This library only supports two ways of building a localized time. The
  71. first is to use the ``localize()`` method provided by the pytz library.
  72. This is used to localize a naive datetime (datetime with no timezone
  73. information):
  74. >>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0))
  75. >>> print(loc_dt.strftime(fmt))
  76. 2002-10-27 06:00:00 EST-0500
  77. The second way of building a localized time is by converting an existing
  78. localized time using the standard ``astimezone()`` method:
  79. >>> ams_dt = loc_dt.astimezone(amsterdam)
  80. >>> ams_dt.strftime(fmt)
  81. '2002-10-27 12:00:00 CET+0100'
  82. Unfortunately using the tzinfo argument of the standard datetime
  83. constructors ''does not work'' with pytz for many timezones.
  84. >>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt)
  85. '2002-10-27 12:00:00 LMT+0020'
  86. It is safe for timezones without daylight saving transitions though, such
  87. as UTC:
  88. >>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt)
  89. '2002-10-27 12:00:00 UTC+0000'
  90. The preferred way of dealing with times is to always work in UTC,
  91. converting to localtime only when generating output to be read
  92. by humans.
  93. >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
  94. >>> loc_dt = utc_dt.astimezone(eastern)
  95. >>> loc_dt.strftime(fmt)
  96. '2002-10-27 01:00:00 EST-0500'
  97. This library also allows you to do date arithmetic using local
  98. times, although it is more complicated than working in UTC as you
  99. need to use the ``normalize()`` method to handle daylight saving time
  100. and other timezone transitions. In this example, ``loc_dt`` is set
  101. to the instant when daylight saving time ends in the US/Eastern
  102. timezone.
  103. >>> before = loc_dt - timedelta(minutes=10)
  104. >>> before.strftime(fmt)
  105. '2002-10-27 00:50:00 EST-0500'
  106. >>> eastern.normalize(before).strftime(fmt)
  107. '2002-10-27 01:50:00 EDT-0400'
  108. >>> after = eastern.normalize(before + timedelta(minutes=20))
  109. >>> after.strftime(fmt)
  110. '2002-10-27 01:10:00 EST-0500'
  111. Creating local times is also tricky, and the reason why working with
  112. local times is not recommended. Unfortunately, you cannot just pass
  113. a ``tzinfo`` argument when constructing a datetime (see the next
  114. section for more details)
  115. >>> dt = datetime(2002, 10, 27, 1, 30, 0)
  116. >>> dt1 = eastern.localize(dt, is_dst=True)
  117. >>> dt1.strftime(fmt)
  118. '2002-10-27 01:30:00 EDT-0400'
  119. >>> dt2 = eastern.localize(dt, is_dst=False)
  120. >>> dt2.strftime(fmt)
  121. '2002-10-27 01:30:00 EST-0500'
  122. Converting between timezones also needs special attention. We also need
  123. to use the ``normalize()`` method to ensure the conversion is correct.
  124. >>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899))
  125. >>> utc_dt.strftime(fmt)
  126. '2006-03-26 21:34:59 UTC+0000'
  127. >>> au_tz = timezone('Australia/Sydney')
  128. >>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
  129. >>> au_dt.strftime(fmt)
  130. '2006-03-27 08:34:59 AEDT+1100'
  131. >>> utc_dt2 = utc.normalize(au_dt.astimezone(utc))
  132. >>> utc_dt2.strftime(fmt)
  133. '2006-03-26 21:34:59 UTC+0000'
  134. You can take shortcuts when dealing with the UTC side of timezone
  135. conversions. ``normalize()`` and ``localize()`` are not really
  136. necessary when there are no daylight saving time transitions to
  137. deal with.
  138. >>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc)
  139. >>> utc_dt.strftime(fmt)
  140. '2006-03-26 21:34:59 UTC+0000'
  141. >>> au_tz = timezone('Australia/Sydney')
  142. >>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
  143. >>> au_dt.strftime(fmt)
  144. '2006-03-27 08:34:59 AEDT+1100'
  145. >>> utc_dt2 = au_dt.astimezone(utc)
  146. >>> utc_dt2.strftime(fmt)
  147. '2006-03-26 21:34:59 UTC+0000'
  148. ``tzinfo`` API
  149. --------------
  150. The ``tzinfo`` instances returned by the ``timezone()`` function have
  151. been extended to cope with ambiguous times by adding an ``is_dst``
  152. parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods.
  153. >>> tz = timezone('America/St_Johns')
  154. >>> normal = datetime(2009, 9, 1)
  155. >>> ambiguous = datetime(2009, 10, 31, 23, 30)
  156. The ``is_dst`` parameter is ignored for most timestamps. It is only used
  157. during DST transition ambiguous periods to resulve that ambiguity.
  158. >>> tz.utcoffset(normal, is_dst=True)
  159. datetime.timedelta(-1, 77400)
  160. >>> tz.dst(normal, is_dst=True)
  161. datetime.timedelta(0, 3600)
  162. >>> tz.tzname(normal, is_dst=True)
  163. 'NDT'
  164. >>> tz.utcoffset(ambiguous, is_dst=True)
  165. datetime.timedelta(-1, 77400)
  166. >>> tz.dst(ambiguous, is_dst=True)
  167. datetime.timedelta(0, 3600)
  168. >>> tz.tzname(ambiguous, is_dst=True)
  169. 'NDT'
  170. >>> tz.utcoffset(normal, is_dst=False)
  171. datetime.timedelta(-1, 77400)
  172. >>> tz.dst(normal, is_dst=False)
  173. datetime.timedelta(0, 3600)
  174. >>> tz.tzname(normal, is_dst=False)
  175. 'NDT'
  176. >>> tz.utcoffset(ambiguous, is_dst=False)
  177. datetime.timedelta(-1, 73800)
  178. >>> tz.dst(ambiguous, is_dst=False)
  179. datetime.timedelta(0)
  180. >>> tz.tzname(ambiguous, is_dst=False)
  181. 'NST'
  182. If ``is_dst`` is not specified, ambiguous timestamps will raise
  183. an ``pytz.exceptions.AmbiguousTimeError`` exception.
  184. >>> tz.utcoffset(normal)
  185. datetime.timedelta(-1, 77400)
  186. >>> tz.dst(normal)
  187. datetime.timedelta(0, 3600)
  188. >>> tz.tzname(normal)
  189. 'NDT'
  190. >>> import pytz.exceptions
  191. >>> try:
  192. ... tz.utcoffset(ambiguous)
  193. ... except pytz.exceptions.AmbiguousTimeError:
  194. ... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
  195. pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
  196. >>> try:
  197. ... tz.dst(ambiguous)
  198. ... except pytz.exceptions.AmbiguousTimeError:
  199. ... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
  200. pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
  201. >>> try:
  202. ... tz.tzname(ambiguous)
  203. ... except pytz.exceptions.AmbiguousTimeError:
  204. ... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
  205. pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
  206. Problems with Localtime
  207. ~~~~~~~~~~~~~~~~~~~~~~~
  208. The major problem we have to deal with is that certain datetimes
  209. may occur twice in a year. For example, in the US/Eastern timezone
  210. on the last Sunday morning in October, the following sequence
  211. happens:
  212. - 01:00 EDT occurs
  213. - 1 hour later, instead of 2:00am the clock is turned back 1 hour
  214. and 01:00 happens again (this time 01:00 EST)
  215. In fact, every instant between 01:00 and 02:00 occurs twice. This means
  216. that if you try and create a time in the 'US/Eastern' timezone
  217. the standard datetime syntax, there is no way to specify if you meant
  218. before of after the end-of-daylight-saving-time transition. Using the
  219. pytz custom syntax, the best you can do is make an educated guess:
  220. >>> loc_dt = eastern.localize(datetime(2002, 10, 27, 1, 30, 00))
  221. >>> loc_dt.strftime(fmt)
  222. '2002-10-27 01:30:00 EST-0500'
  223. As you can see, the system has chosen one for you and there is a 50%
  224. chance of it being out by one hour. For some applications, this does
  225. not matter. However, if you are trying to schedule meetings with people
  226. in different timezones or analyze log files it is not acceptable.
  227. The best and simplest solution is to stick with using UTC. The pytz
  228. package encourages using UTC for internal timezone representation by
  229. including a special UTC implementation based on the standard Python
  230. reference implementation in the Python documentation.
  231. The UTC timezone unpickles to be the same instance, and pickles to a
  232. smaller size than other pytz tzinfo instances. The UTC implementation
  233. can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC').
  234. >>> import pickle, pytz
  235. >>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
  236. >>> naive = dt.replace(tzinfo=None)
  237. >>> p = pickle.dumps(dt, 1)
  238. >>> naive_p = pickle.dumps(naive, 1)
  239. >>> len(p) - len(naive_p)
  240. 17
  241. >>> new = pickle.loads(p)
  242. >>> new == dt
  243. True
  244. >>> new is dt
  245. False
  246. >>> new.tzinfo is dt.tzinfo
  247. True
  248. >>> pytz.utc is pytz.UTC is pytz.timezone('UTC')
  249. True
  250. Note that some other timezones are commonly thought of as the same (GMT,
  251. Greenwich, Universal, etc.). The definition of UTC is distinct from these
  252. other timezones, and they are not equivalent. For this reason, they will
  253. not compare the same in Python.
  254. >>> utc == pytz.timezone('GMT')
  255. False
  256. See the section `What is UTC`_, below.
  257. If you insist on working with local times, this library provides a
  258. facility for constructing them unambiguously:
  259. >>> loc_dt = datetime(2002, 10, 27, 1, 30, 00)
  260. >>> est_dt = eastern.localize(loc_dt, is_dst=True)
  261. >>> edt_dt = eastern.localize(loc_dt, is_dst=False)
  262. >>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt))
  263. 2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500
  264. If you pass None as the is_dst flag to localize(), pytz will refuse to
  265. guess and raise exceptions if you try to build ambiguous or non-existent
  266. times.
  267. For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern
  268. timezone when the clocks where put back at the end of Daylight Saving
  269. Time:
  270. >>> dt = datetime(2002, 10, 27, 1, 30, 00)
  271. >>> try:
  272. ... eastern.localize(dt, is_dst=None)
  273. ... except pytz.exceptions.AmbiguousTimeError:
  274. ... print('pytz.exceptions.AmbiguousTimeError: %s' % dt)
  275. pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00
  276. Similarly, 2:30am on 7th April 2002 never happened at all in the
  277. US/Eastern timezone, as the clocks where put forward at 2:00am skipping
  278. the entire hour:
  279. >>> dt = datetime(2002, 4, 7, 2, 30, 00)
  280. >>> try:
  281. ... eastern.localize(dt, is_dst=None)
  282. ... except pytz.exceptions.NonExistentTimeError:
  283. ... print('pytz.exceptions.NonExistentTimeError: %s' % dt)
  284. pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00
  285. Both of these exceptions share a common base class to make error handling
  286. easier:
  287. >>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError)
  288. True
  289. >>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError)
  290. True
  291. A special case is where countries change their timezone definitions
  292. with no daylight savings time switch. For example, in 1915 Warsaw
  293. switched from Warsaw time to Central European time with no daylight savings
  294. transition. So at the stroke of midnight on August 5th 1915 the clocks
  295. were wound back 24 minutes creating an ambiguous time period that cannot
  296. be specified without referring to the timezone abbreviation or the
  297. actual UTC offset. In this case midnight happened twice, neither time
  298. during a daylight saving time period. pytz handles this transition by
  299. treating the ambiguous period before the switch as daylight savings
  300. time, and the ambiguous period after as standard time.
  301. >>> warsaw = pytz.timezone('Europe/Warsaw')
  302. >>> amb_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=True)
  303. >>> amb_dt1.strftime(fmt)
  304. '1915-08-04 23:59:59 WMT+0124'
  305. >>> amb_dt2 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False)
  306. >>> amb_dt2.strftime(fmt)
  307. '1915-08-04 23:59:59 CET+0100'
  308. >>> switch_dt = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False)
  309. >>> switch_dt.strftime(fmt)
  310. '1915-08-05 00:00:00 CET+0100'
  311. >>> str(switch_dt - amb_dt1)
  312. '0:24:01'
  313. >>> str(switch_dt - amb_dt2)
  314. '0:00:01'
  315. The best way of creating a time during an ambiguous time period is
  316. by converting from another timezone such as UTC:
  317. >>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc)
  318. >>> utc_dt.astimezone(warsaw).strftime(fmt)
  319. '1915-08-04 23:36:00 CET+0100'
  320. The standard Python way of handling all these ambiguities is not to
  321. handle them, such as demonstrated in this example using the US/Eastern
  322. timezone definition from the Python documentation (Note that this
  323. implementation only works for dates between 1987 and 2006 - it is
  324. included for tests only!):
  325. >>> from pytz.reference import Eastern # pytz.reference only for tests
  326. >>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern)
  327. >>> str(dt)
  328. '2002-10-27 00:30:00-04:00'
  329. >>> str(dt + timedelta(hours=1))
  330. '2002-10-27 01:30:00-05:00'
  331. >>> str(dt + timedelta(hours=2))
  332. '2002-10-27 02:30:00-05:00'
  333. >>> str(dt + timedelta(hours=3))
  334. '2002-10-27 03:30:00-05:00'
  335. Notice the first two results? At first glance you might think they are
  336. correct, but taking the UTC offset into account you find that they are
  337. actually two hours appart instead of the 1 hour we asked for.
  338. >>> from pytz.reference import UTC # pytz.reference only for tests
  339. >>> str(dt.astimezone(UTC))
  340. '2002-10-27 04:30:00+00:00'
  341. >>> str((dt + timedelta(hours=1)).astimezone(UTC))
  342. '2002-10-27 06:30:00+00:00'
  343. Country Information
  344. ~~~~~~~~~~~~~~~~~~~
  345. A mechanism is provided to access the timezones commonly in use
  346. for a particular country, looked up using the ISO 3166 country code.
  347. It returns a list of strings that can be used to retrieve the relevant
  348. tzinfo instance using ``pytz.timezone()``:
  349. >>> print(' '.join(pytz.country_timezones['nz']))
  350. Pacific/Auckland Pacific/Chatham
  351. The Olson database comes with a ISO 3166 country code to English country
  352. name mapping that pytz exposes as a dictionary:
  353. >>> print(pytz.country_names['nz'])
  354. New Zealand
  355. What is UTC
  356. ~~~~~~~~~~~
  357. 'UTC' is `Coordinated Universal Time`_. It is a successor to, but distinct
  358. from, Greenwich Mean Time (GMT) and the various definitions of Universal
  359. Time. UTC is now the worldwide standard for regulating clocks and time
  360. measurement.
  361. All other timezones are defined relative to UTC, and include offsets like
  362. UTC+0800 - hours to add or subtract from UTC to derive the local time. No
  363. daylight saving time occurs in UTC, making it a useful timezone to perform
  364. date arithmetic without worrying about the confusion and ambiguities caused
  365. by daylight saving time transitions, your country changing its timezone, or
  366. mobile computers that roam through multiple timezones.
  367. .. _Coordinated Universal Time: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
  368. Helpers
  369. ~~~~~~~
  370. There are two lists of timezones provided.
  371. ``all_timezones`` is the exhaustive list of the timezone names that can
  372. be used.
  373. >>> from pytz import all_timezones
  374. >>> len(all_timezones) >= 500
  375. True
  376. >>> 'Etc/Greenwich' in all_timezones
  377. True
  378. ``common_timezones`` is a list of useful, current timezones. It doesn't
  379. contain deprecated zones or historical zones, except for a few I've
  380. deemed in common usage, such as US/Eastern (open a bug report if you
  381. think other timezones are deserving of being included here). It is also
  382. a sequence of strings.
  383. >>> from pytz import common_timezones
  384. >>> len(common_timezones) < len(all_timezones)
  385. True
  386. >>> 'Etc/Greenwich' in common_timezones
  387. False
  388. >>> 'Australia/Melbourne' in common_timezones
  389. True
  390. >>> 'US/Eastern' in common_timezones
  391. True
  392. >>> 'Canada/Eastern' in common_timezones
  393. True
  394. >>> 'US/Pacific-New' in all_timezones
  395. True
  396. >>> 'US/Pacific-New' in common_timezones
  397. False
  398. Both ``common_timezones`` and ``all_timezones`` are alphabetically
  399. sorted:
  400. >>> common_timezones_dupe = common_timezones[:]
  401. >>> common_timezones_dupe.sort()
  402. >>> common_timezones == common_timezones_dupe
  403. True
  404. >>> all_timezones_dupe = all_timezones[:]
  405. >>> all_timezones_dupe.sort()
  406. >>> all_timezones == all_timezones_dupe
  407. True
  408. ``all_timezones`` and ``common_timezones`` are also available as sets.
  409. >>> from pytz import all_timezones_set, common_timezones_set
  410. >>> 'US/Eastern' in all_timezones_set
  411. True
  412. >>> 'US/Eastern' in common_timezones_set
  413. True
  414. >>> 'Australia/Victoria' in common_timezones_set
  415. False
  416. You can also retrieve lists of timezones used by particular countries
  417. using the ``country_timezones()`` function. It requires an ISO-3166
  418. two letter country code.
  419. >>> from pytz import country_timezones
  420. >>> print(' '.join(country_timezones('ch')))
  421. Europe/Zurich
  422. >>> print(' '.join(country_timezones('CH')))
  423. Europe/Zurich
  424. Internationalization - i18n/l10n
  425. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  426. Pytz is an interface to the IANA database, which uses ASCII names. The `Unicode Consortium's Unicode Locales (CLDR) <http://cldr.unicode.org>`_
  427. project provides translations. Thomas Khyn's
  428. `l18n <https://pypi.python.org/pypi/l18n>`_ package can be used to access
  429. these translations from Python.
  430. License
  431. ~~~~~~~
  432. MIT license.
  433. This code is also available as part of Zope 3 under the Zope Public
  434. License, Version 2.1 (ZPL).
  435. I'm happy to relicense this code if necessary for inclusion in other
  436. open source projects.
  437. Latest Versions
  438. ~~~~~~~~~~~~~~~
  439. This package will be updated after releases of the Olson timezone
  440. database. The latest version can be downloaded from the `Python Package
  441. Index <http://pypi.python.org/pypi/pytz/>`_. The code that is used
  442. to generate this distribution is hosted on launchpad.net and available
  443. using the `Bazaar version control system <http://bazaar-vcs.org>`_
  444. using::
  445. bzr branch lp:pytz
  446. Announcements of new releases are made on
  447. `Launchpad <https://launchpad.net/pytz>`_, and the
  448. `Atom feed <http://feeds.launchpad.net/pytz/announcements.atom>`_
  449. hosted there.
  450. Bugs, Feature Requests & Patches
  451. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  452. Bugs can be reported using `Launchpad <https://bugs.launchpad.net/pytz>`_.
  453. Issues & Limitations
  454. ~~~~~~~~~~~~~~~~~~~~
  455. - Offsets from UTC are rounded to the nearest whole minute, so timezones
  456. such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This
  457. is a limitation of the Python datetime library.
  458. - If you think a timezone definition is incorrect, I probably can't fix
  459. it. pytz is a direct translation of the Olson timezone database, and
  460. changes to the timezone definitions need to be made to this source.
  461. If you find errors they should be reported to the time zone mailing
  462. list, linked from http://www.iana.org/time-zones.
  463. Further Reading
  464. ~~~~~~~~~~~~~~~
  465. More info than you want to know about timezones:
  466. http://www.twinsun.com/tz/tz-link.htm
  467. Contact
  468. ~~~~~~~
  469. Stuart Bishop <stuart@stuartbishop.net>