New issue
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
Add tzset method to time module #37842
Comments
Adds access to the tzset method, allowing you to change your local timezone as required. In addition to invoking the tzset system Also includes changes to configure.in to only build new code if the tzset method correctly switches timezones on your platform. This Also includes tests in test_time.py Docs would be along the lines of: tzset() -- eg:: >>> now = time.time()
>>> os.environ['TZ'] = 'Europe/Amsterdam'
>>> time.tzset()
>>> time.ctime(now)
'Mon Jan 27 14:35:17 2003'
>>> time.tzname
('CET', 'CEST')
>>> os.environ['TZ'] = 'US/Eastern'
>>> time.tzset()
>>> time.ctime(now)
'Mon Jan 27 08:35:17 2003'
>>> time.tzname
('EST', 'EDT') |
Logged In: YES Assigning to Guido for consideration of being added to |
Logged In: YES Uh? This is a new feature, so doesn't apply to 2.2.3. Maybe you meant 2.3? |
Logged In: YES It is a patch to 2.3, but I'd though I'd try and sneak this |
Logged In: YES Sorry, not a chance. |
Logged In: YES zenzen: when I run the test suite on my Red Hat Linux 7.3 If I comment out that one line the tzset test suite passes. What should I do? |
Logged In: YES Leave it commented out or remove that line. It is testing a) the system silently falls back to UTC if the timezone is b) calling tzset resets tzname, which is also tested elsewhere. |
Logged In: YES OK, checked in with that line removed. Thanks! |
Logged In: YES test_time is now failing on Solaris 8. altzone is -3600, |
Logged In: YES An update to this patch is now available: |
Logged In: YES Closing again, the problem can be addressed thru the other |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: