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 mitya57
Recipients mitya57
Date 2014-11-24.10:49:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416826159.48.0.941875897993.issue22930@psf.upfronthosting.co.za>
In-reply-to
Content
Here, on Linux, I get:

$ python3 -c "import time; print(time.timezone)"
-14400

… which means I am in UTC+4. However, Russia recently (in October) switched time, and moved from UTC+4 to UTC+3 timezone (my tzdata is up-to-date), so this reported value is wrong.

The relevant code in timemodule.c looks like (simplified):

  #define YEAR ((time_t)((365 * 24 + 6) * 3600))
  time_t t = (time((time_t *)0) / YEAR) * YEAR;
  struct tm *p = localtime(&t);
  janzone = -p->tm_gmtoff;
  PyModule_AddIntConstant(m, "timezone", janzone);

The value of t is the *January 1st* of current year, i.e. 2014-01-01 currently. But the timezone of a country in the year beginning may be different from its timezone in the year end, which is the case for me.

This bug will be relevant for Russia until the end of 2014, but may be still relevant for other countries that wish to change their timezone.
History
Date User Action Args
2014-11-24 10:49:19mitya57setrecipients: + mitya57
2014-11-24 10:49:19mitya57setmessageid: <1416826159.48.0.941875897993.issue22930@psf.upfronthosting.co.za>
2014-11-24 10:49:19mitya57linkissue22930 messages
2014-11-24 10:49:18mitya57create