Comment 3 for bug 1678858

Stuart Bishop (stub) wrote :

pytz.timezone('Asia/Tokyo') is the timezone definition for Tokyo at an arbitrary point in history. It happens to be the first one in the IANA database, which usually dates from before 1900 and often has a fractional hour as the offset making these bugs easy to spot. I don't think there were any relevant code changes changing the arbitrary zoneinfo that timezone('Asia/Tokyo') returns, so suspect the definition in the database changed; probably historic information being added. 'LMT' is used for Local Mean Time, where noon is when the sun is at its highest point over the civic centre and mostly hasn't been used since telegraph and railroad networks were built. In this case, for times pre 1888

The documented mechanisms for creating localized timezones, such as timezone('Asia/Tokyo').localize(datetime(2002, 10, 27, 6, 0, 0)) are needed so that the correct tzinfo is used for that particular location and point in time. pytz.timezone('Asia/Tokyo') alone has just the location, and could represent one of dozens of correct tzinfos for the various historical and future points in time. It would have been nice for datetime(..., tzinfo=timezone(...)) to work, but it has always been impossible until the very latest versions of Python3.