Skip to content
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

Python's timezon handling: daylight saving option #49131

Closed
earendili510 mannequin opened this issue Jan 8, 2009 · 9 comments
Closed

Python's timezon handling: daylight saving option #49131

earendili510 mannequin opened this issue Jan 8, 2009 · 9 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@earendili510
Copy link
Mannequin

earendili510 mannequin commented Jan 8, 2009

BPO 4881
Nosy @loewis, @devdanzin

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:

assignee = None
closed_at = <Date 2009-01-12.05:09:42.577>
created_at = <Date 2009-01-08.15:03:00.755>
labels = ['type-feature', 'library']
title = "Python's timezon handling: daylight saving option"
updated_at = <Date 2009-01-13.15:46:31.253>
user = 'https://bugs.python.org/earendili510'

bugs.python.org fields:

activity = <Date 2009-01-13.15:46:31.253>
actor = 'earendili510'
assignee = 'none'
closed = True
closed_date = <Date 2009-01-12.05:09:42.577>
closer = 'loewis'
components = ['Library (Lib)']
creation = <Date 2009-01-08.15:03:00.755>
creator = 'earendili510'
dependencies = []
files = []
hgrepos = []
issue_num = 4881
keywords = []
message_count = 9.0
messages = ['79415', '79437', '79452', '79476', '79496', '79642', '79646', '79713', '79746']
nosy_count = 3.0
nosy_names = ['loewis', 'ajaksu2', 'earendili510']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue4881'
versions = ['3rd party']

@earendili510
Copy link
Mannequin Author

earendili510 mannequin commented Jan 8, 2009

Something in python's timezone handling needs to be
updated. Python does not take into account 'daylight saving' clock time
changes.

The thing is my clock time is correct. If you
ask anyone here for the time, they will tell you it's X. However, Python
believes (correct) current time is X + 1 hour. In fact, this is the case
most of the time, but because of 'daylight saving' measures, official
time has been changed. So, without a doubt, this needs to be fixed.

A solution could be adding the possibility to set a 'daylight saving'
option which helps dealing with this. So, if I set this option to 3600
secs, then Python could +/- this remainder to the, let's call it,
'expected current time' according to the timezone.

@earendili510 earendili510 mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jan 8, 2009
@loewis
Copy link
Mannequin

loewis mannequin commented Jan 8, 2009

Can you provide more details? What is the specific Python source code
that you are running, what operating system you run it one, what time
zone has been configured into your system, what output do you get, what
output do you expect?

Python definitely does support daylight saving time already just fine.

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Jan 9, 2009

Pablo,
As Martin says, Python does support DST changes. But it might not have
enough information about your timezone. If that's the case, take a look
at these links to see how adding (up-to-date) support for your tz can be
achieved:

Building a tzinfo class ->
http://svn.python.org/view/python/trunk/Doc/includes/tzinfo-examples.py?rev=62214&view=auto

Using the TZ environment variable ->
http://docs.python.org/dev/library/time.html#time.tzset

HTH, Daniel

@earendili510
Copy link
Mannequin Author

earendili510 mannequin commented Jan 9, 2009

Ok, first of all I want to say I'm no Python programmer/developer.
However, I recently posted a 'bug' for a Linux/Windows program I'm using
very much which is based in Python. The program is called Anki and it's
designed to help you remember facts (such as words and phrases in a
foreign language) as easily, quickly and efficiently as possible.

Here, http://code.google.com/p/anki/issues/detail?id=613, you'll find my
explanation of the 'bug'.

Briefly, I live in Argentina and the current administration has changed
current time because of 'daylight saving'. However, when syncing my
decks (which store all my cards) with Anki's server, it tells me my
current time is wrong and that I need to change it. In fact, it's not MY
clock which is wrong, but Anki's. So, I posted this bug and the
developer, as you can see, told me that: it's not really anki's job - a
setting to shift the clock would need changes all throughout the code.
probably something in python's timezone handling needs to be updated.
could you post about the daylight savings issue on the python mailing
list and see what they say? So, this is what I'm doing.

Right now I will notify the developer of this program that, actually,
Python already handles 'time saving'.

Thanks for your help. Any other comments/ideas would be greatly appreciated.

@loewis
Copy link
Mannequin

loewis mannequin commented Jan 9, 2009

For Windows (what version are you using?), you need to install
Microsoft's time zone patches, e.g. the one described in

http://support.microsoft.com/kb/951072

Depending on the exact version of Windows that you use, and depending on
whether or not you run Windows update regularly, your system may or may
not have that patch installed.

Same for Linux, except that I can't point to a single update. What
precise Linux distribution are you using? Have you installed their time
zone updates?

@earendili510
Copy link
Mannequin Author

earendili510 mannequin commented Jan 12, 2009

the last post on that link is the point - python supports daylight
savings, but if
your city recently started using daylight savings, and didn't before,
then either
python or linux needs to be updated to know that.

I'm using Ubuntu Intrepid Ibex.

@loewis
Copy link
Mannequin

loewis mannequin commented Jan 12, 2009

For Ubuntu Intrepid, you need the package tzdata 2008h-2ubuntu1
installed; it contains a correction for the Argentinian DST definition.
Intrepid itself only shipped with 2008h-2.

Closing this as third-party.

@loewis loewis mannequin closed this as completed Jan 12, 2009
@earendili510
Copy link
Mannequin Author

earendili510 mannequin commented Jan 13, 2009

Ok, everything seems to be working now in Ubuntu. However, I can't get
it work in WIN XP (at work). :(

Thanks for all your help!

@earendili510
Copy link
Mannequin Author

earendili510 mannequin commented Jan 13, 2009

Ok. I installed the WIN XP patch loewis talked about...and now
everything works smoothly in Windows too. Thanks!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

0 participants