[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0f0e3ec22fce by Alexander Belopolsky in branch 'default': Issue #9527: tm_gmtoff has 'correct' sign. http://hg.python.org/cpython/rev/0f0e3ec22fce -- ___ Python tracker

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Working on this. It turns out tm_gmtoff uses the opposite sign to that of timezone in time.h. For more confusion, consider this: $ TZ=EST+5 date +%z -0500 I am rechecking all UTC offset signs. On Fri, Jun 22, 2012 at 3:36 PM, Jesús Cea Avión wrote: >

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: This patch breaks OpenIndiana buildbots. For instance http://www.python.org/dev/buildbot/all/builders/AMD64%20OpenIndiana%203.x/builds/3810/steps/test/logs/stdio """ FAIL: test_astimezone_default_eastern (test.datetimetester.TestDateTimeTZ_Pure) -

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset a7237f157625 by Alexander Belopolsky in branch 'default': Issue #9527: Fixes for platforms without tm_zone http://hg.python.org/cpython/rev/a7237f157625 -- ___ Python tracker

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 88a5f2730579 by Alexander Belopolsky in branch 'default': Issue #9527: datetime.astimezone() method will now supply a class http://hg.python.org/cpython/rev/88a5f2730579 New changeset 336c53c1f547 by Alexander Belopolsky in branch 'default': Issue

[issue9527] Add aware local time support to datetime module

2012-06-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue9527] Add aware local time support to datetime module

2012-06-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch implements astimezone() default in both Python and C. -- stage: -> patch review Added file: http://bugs.python.org/file26062/issue9527.diff ___ Python tracker

[issue9527] Add aware local time support to datetime module

2012-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > ... is a well-defined problem which does not have an adequate solution. I meant to say "does not have an adequate solution *in the current datetime module*". I think the enhanced datetime.astimezone() method will solve this problem. -- ___

[issue9527] Add aware local time support to datetime module

2012-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jun 11, 2012 at 11:18 PM, James Henstridge wrote: > One problem I can see with using a fixed offset > tzinfo for localtime is that it might confuse people > when doing date arithmetic. Yes, this is the issue that I discussed in my first python-i

[issue9527] Add aware local time support to datetime module

2012-06-11 Thread James Henstridge
James Henstridge added the comment: One problem I can see with using a fixed offset tzinfo for localtime is that it might confuse people when doing date arithmetic. For example: >>> d = datetime.localtime() + timedelta(days=7) While it will give a correct answer as a point in time it wil

[issue9527] Add aware local time support to datetime module

2012-06-11 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file25940/testtz.py ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue9527] Add aware local time support to datetime module

2012-06-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Two objections have been raised to the proposed datetime.localtime() function: 1. It offers the third subtly different way to obtain current time in datetime module. The first two being provided by datetime.now() and datetime.today(). 2. C library loca

[issue9527] Add aware local time support to datetime module

2012-06-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This was originally posted on python-dev, but I hope reposting it here will make this issue easier to navigate. """ With addition of fixed offset timezone class and the timezone.utc instance [0], it is easy to get UTC time as an aware datetime instance:

[issue9527] Add aware local time support to datetime module

2012-06-05 Thread Cameron Simpson
Changes by Cameron Simpson : -- nosy: +cameron ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9527] Add aware local time support to datetime module

2012-06-05 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue9527] Add aware local time support to datetime module

2012-05-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset df12ce0c96eb by R David Murray in branch 'default': #665194: Add a localtime function to email.utils. http://hg.python.org/cpython/rev/df12ce0c96eb -- nosy: +python-dev ___ Python tracker

[issue9527] Add aware local time support to datetime module

2012-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: One important thing to remember is that once a time is in the past, whether or not DST was in effect for that time *is never going to change*. That means converting a DST aware timezone to a fixed offset timezone will work just fine for historical times. It's

[issue9527] Add aware local time support to datetime module

2011-05-05 Thread R. David Murray
R. David Murray added the comment: LocalTimezone support would be *really* helpful for the email module. It would allow us to have unambiguous semantics for datetime objects representing timestamps exacted from or inserted into email messages (see issue 665194 for recent discussion). The em

[issue9527] Add aware local time support to datetime module

2011-01-30 Thread Miki Tebeka
Changes by Miki Tebeka : -- nosy: -tebeka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue9527] Add aware local time support to datetime module

2011-01-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sat, Jan 29, 2011 at 11:56 PM, Raymond Hettinger wrote: .. > Also, I question whether the proposed API is correct.  ISTM that any code > that sets the *dst* > parameter is guaranteed to be wrong (hardwiring-in a value that will change > every few mon

[issue9527] Add aware local time support to datetime module

2011-01-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think Tim and Guido had deliberately avoided local timezone awareness when they designed the module. Also, I question whether the proposed API is correct. ISTM that any code that sets the *dst* parameter is guaranteed to be wrong (hardwiring-in a value

[issue9527] Add aware local time support to datetime module

2011-01-29 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +No obvious and correct way to get the time zone offset ___ Python tracker ___ ___ P

[issue9527] Add aware local time support to datetime module

2011-01-29 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Time zone-capable variant of time.localtime ___ Python tracker ___ ___ Python-bugs-

[issue9527] Add aware local time support to datetime module

2011-01-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- title: Add aware local time support to datetime module (issue9527) -> Add aware local time support to datetime module ___ Python tracker <http://bugs.python.org/iss

[issue9527] Add aware local time support to datetime module (issue9527)

2011-01-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Forwarding Rietveld conversation to the tracker. It looks like Rietveld integration has a bug and sends reviews to n...@psf.upfronthosting.co.za rather than to rep...@bugs.python.org. Forwarded conversation Subject: Add aware local time support to dateti

[issue9527] Add aware local time support to datetime module

2011-01-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Following Anatoly's review, I renamed datetime argument and a local variable, added comments and expanded docstring. I am uploading a new patch: datetime-localtime-proto-1.diff. Martin, I could not figure out how to add the new patch to rietveld and I

[issue9527] Add aware local time support to datetime module

2010-12-01 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9527] Add aware local time support to datetime module

2010-10-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Would anyone like to review this? The Rietveld link works (thanks Martin!) and I would like to get some feedback on the python version before I invest effort into coding this in C. -- ___ Python tracker

[issue9527] Add aware local time support to datetime module

2010-08-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue9527] Add aware local time support to datetime module

2010-08-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Merging nosy lists from issues #1647654 and #2736. If datetime.localtime() is implemented, I argue that the features requested in these two issues will become unnecessary. -- nosy: +Neil Muller, amaury.forgeotdarc, andersjm, catlee, davidfraser

[issue9527] Add aware local time support to datetime module

2010-08-05 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : See python-dev post for motivation. http://mail.python.org/pipermail/python-dev/2010-August/102842.html I am attaching a patch implementing the proposed method in datetime.py. I will also paste the code below. Note that this is only prototype. Rea