We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02f87ce commit 2fda6f8Copy full SHA for 2fda6f8
src/pendulum/tz/local_timezone.py
@@ -150,6 +150,9 @@ def _get_windows_timezone() -> Timezone:
150
151
152
def _get_darwin_timezone() -> Timezone:
153
+ if tzenv := os.environ.get("TZ"):
154
+ with contextlib.suppress(ValueError):
155
+ return _tz_from_env(tzenv)
156
# link will be something like /usr/share/zoneinfo/America/Los_Angeles.
157
link = os.readlink("/etc/localtime")
158
tzname = link[link.rfind("zoneinfo/") + 9 :]
0 commit comments