This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author akira
Recipients akira, belopolsky
Date 2015-01-28.18:55:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422471349.39.0.525165398338.issue22799@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that time.timezone, time.altzone is not enough in the general
case. Because UTC offset may be different at different dates for 
reasons unrelated to DST transitions therefore any solution that 
doesn't take into account a given date/time into account will fail.

*Nothing* works in the general case. Nothing.

But it doesn't mean that the current behaviour of time.timezone
can't be improved for this particular use-case:

  lt = time.localtime() # in a short-lived script
  assertEqual(lt.tm_gmtoff, -[time.timezone, time.altzone][lt.tm_isdst])

The test checks values for the current time (time.localtime()).
It should work in *most* cases if time.timezone/altzone have correct 
values at import time.

Perhaps synchronizing time.timezone with C timezone variable as I've
mentioned before http://bugs.python.org/issue22798 may fix this issue
too.
History
Date User Action Args
2015-01-28 18:55:49akirasetrecipients: + akira, belopolsky
2015-01-28 18:55:49akirasetmessageid: <1422471349.39.0.525165398338.issue22799@psf.upfronthosting.co.za>
2015-01-28 18:55:49akiralinkissue22799 messages
2015-01-28 18:55:49akiracreate