We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is on macOS Sierra 10.12.3 (16D32)
% systemsetup -gettimezone You need administrator access to run this tool... exiting!
def _get_localzone(): pipe = subprocess.Popen( "systemsetup -gettimezone", shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE ) tzname = pipe.stdout.read().replace(b'Time Zone: ', b'').strip() if not tzname or tzname not in pytz.all_timezones_set: # link will be something like /usr/share/zoneinfo/America/Los_Angeles. link = os.readlink("/etc/localtime") tzname = link[link.rfind("zoneinfo/") + 9:] return pytz.timezone(tzname)
The text was updated successfully, but these errors were encountered:
It should then fall back to the os.readlink way, so it shouldn't be a problem.
Sorry, something went wrong.
tzlocal will stop trying to use systemsetup in next release.
No branches or pull requests
This is on macOS Sierra 10.12.3 (16D32)
% systemsetup -gettimezone
You need administrator access to run this tool... exiting!
The text was updated successfully, but these errors were encountered: