Correct but misleading documentation

Bug #1435182 reported by Eric O LEBIGOT (EOL) on 2015-03-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stuart Bishop

Bug Description

The documentation gives the following example:

>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt)
'2002-10-27 12:00:00 LMT+0020'

The problem is that I was working on a difficult project for which I needed time zone support, so I quickly skimmed through the example code, found the line above, and then happily imported it into my program.

I am sure that I am not the only one who got caught by this. One prominent example is a recent blog entry *which specifically talks about time zones* and only quotes the incorrect way of doing things (, as if it were a fundamental problem with pytz.

So, I strongly suggest that the documentation contains *a clear warning* around the example that should *not* be followed (bold, special paragraph type,…).

Stuart Bishop (stub) on 2018-10-24
Changed in pytz:
status: New → Fix Committed
assignee: nobody → Stuart Bishop (stub)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers