Correct but misleading documentation

Bug #1435182 reported by Eric O LEBIGOT (EOL)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytz
Fix Released
Undecided
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 (https://www.airpair.com/python/posts/top-mistakes-python-big-data-analytics#4-mistake-3-not-understanding-time-and-timezones), 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)
Changed in pytz:
status: New → Fix Committed
assignee: nobody → Stuart Bishop (stub)
Stuart Bishop (stub)
Changed in pytz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.