2.0.0:
Major differences since 1.5.1
- When no time zone configuration can be find, tzlocal now return UTC.
This is a major difference from 1.x, where an exception would be raised.
This change is because Docker images often have no configuration at all,
and the unix utilities will then default to UTC, so we follow that.
- If tzlocal on Unix finds a timezone name in a /etc config file, then
tzlocal now verifies that the timezone it fouds has the same offset as
the local computer is configured with. If it doesn't, something is
configured incorrectly.
- Get timezone via Termux `getprop` wrapper on Android. It's not officially
supported because we can't test it, but at least we make an effort.
Minor differences and bug fixes
- Skip comment lines when parsing /etc/timezone.
- Don't load timezone from current directory.
- Now verifies that the config files actually contain something before
reading them.
- Got rid of a BytesWarning
- Now handles if config file paths exists, but are directories.
- Moved tests out from distributions
- Support wheels
1.5.1:
- 1.5 had a bug that slipped through testing, fixed that,
increased test coverage.
1.5:
- No longer treats macOS as special, but as a unix.
- get_windows_info.py is renamed to update_windows_mappings.py
- Windows mappings now also contain mappings from deprecated zoneinfo names.
(Preston-Landers, regebro)
I use MIT on my other projects, so relicensing.
Dropping support for Python versions nobody uses (2.5, 3.1, 3.2), adding 3.6 Python 3.1 and 3.2 still works, 2.5 has been broken for some time.
Ayalash’s OS X fix didn’t work on Python 2.7, fixed that.
Problems found with mismatching existing digests for:
distfiles/asclock-classic-1.0.tar.gz
distfiles/asclock-gtk-2.1.10beta.tar.gz
distfiles/asclock-xlib-2.0.11.tar.gz
distfiles/emiclock-2.0.2.tar.gz
Otherwise, existing SHA1 digests verified and found to be the same on
the machine holding the existing distfiles (morden). All existing
SHA1 digests retained for now as an audit trail.
This Python module returns a tzinfo object with the local timezone
information under Unix and Win-32. It requires pytz, and returns
pytz tzinfo objects.
This module attempts to fix a glaring hole in pytz, that there is
no way to get the local timezone information, unless you know the
zoneinfo name, and under several Linux distros that's hard or
impossible to figure out.
Also, with Windows different timezone system using pytz isn't of
much use unless you separately configure the zoneinfo timezone
name.
With tzlocal you only need to call get_localzone() and you will
get a tzinfo object with the local time zone info. On some Unices
you will still not get to know what the timezone name is, but you
don't need that when you have the tzinfo file. However, if the
timezone name is readily available it will be used.