]> granicus.if.org Git - python/commit
bpo-30699: Improve example on datetime tzinfo instances (GH-4290)
authorMario Corchero <mcorcherojim@bloomberg.net>
Tue, 4 Jun 2019 15:18:11 +0000 (16:18 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 4 Jun 2019 15:18:10 +0000 (17:18 +0200)
commitf0b5ae4567637b24035ecda93a3240efc96b6dd9
treedefd933d5ed4a76a61048362c6d1636231221ad2
parentca612a9728b83472d9d286bbea74972d426ed344
bpo-30699: Improve example on datetime tzinfo instances (GH-4290)

* Improve example on tzinfo instances

Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.

* Simplify datetime with tzinfo example

Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.

Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
Doc/library/datetime.rst