-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Don't use east/west of UTC in date/time documentation #53551
Comments
|
I am opening this to supersede bpo-7229. See discussion following msg107148. In many places offsets representing the difference between local time and UTC are described as minutes or seconds east or west of UTC. This is not correct because UTC is not a place and minutes and seconds don't measure distance in this context. Replacing UTC with the Prime Meridian will not fix that because some regions in the western hemisphere use positive offsets from UTC. or example, Madrid is at 3° 42' West, but uses Central European Time which is UTC+1. I believe geographical references in the python documentation are irrelevant. What users are interested in is how to convert local time to UTC and UTC to local time rather than what is the sign of time.timezone in Madrid. I suggest the following wording for time.timezone description: time.timezone: The number of seconds one must add to the local time to arrive at UTC. Similarly, tzinfo.utcoffset() can be defined as "Returns timedelta one must add to UTC to arrive at local time." |
|
On Mon, Jul 19, 2010 at 7:21 PM, Alexander Belopolsky
Makes sense. I can't see any other real explanation for -7200 value if
I believe the correct convention is "Return timedelta...". Another |
|
On Tue, Jul 20, 2010 at 10:46 AM, anatoly techtonik
No, UTC is not a 0 reference point, it is a time scale. UTC offset is Documenting utcoffset() as "Return timedelta equal to local UTC |
|
FYI, I like the change. As I recall it, the current wording was just to avoid saying "ahead of UTC" or "behind UTC" (which was the original wording). Technically pure or not, I never saw anyone get truly confused by "East of UTC" or "West of UTC", but I fully that what people really want to know is what to do with the thing (add or subtract it). |
|
On Tue, Jul 20, 2010 at 10:46 AM, anatoly techtonik <techtonik@gmail.com> wrote:
This is handled inconsistently in the documentation; I'm hoping the -Fred |
Ok. Sold.
http://www.python.org/dev/peps/pep-0257/#one-line-docstrings I've took the convention from here. I thought docs are generated from |
|
On Tue, Jul 20, 2010 at 12:08 PM, anatoly techtonik
They're not, but I don't think that really matters. Older documentation used the imperative form consistently, but that's I don't think it really matters with regard to this issue. |
|
On Tue, Jul 20, 2010 at 11:39 AM, Tim Peters <report@bugs.python.org> wrote:
Interesting. I actually like the original wording better. For me, I wonder if east/west is somehow more natural for native speakers of |
|
On Tue, Jul 20, 2010 at 12:14 PM, Alexander Belopolsky
I was too excited to add Alice in Wonderland humor to my post that did The above should read 18:00 - 6:00 = 12:00, of course. Or was it five |
|
On Tue, Jul 20, 2010 at 12:08 PM, anatoly techtonik
Good. All we need now is just a patch. :-) |
|
Here goes a patch to replace east/west references on datetime documentation. As spoken with fdrake we think the datetime documentation could be improved extracting the timezone subclassing details to specific section. We'll be filling a new issue for that patch. |
1 similar comment
|
Here goes a patch to replace east/west references on datetime documentation. As spoken with fdrake we think the datetime documentation could be improved extracting the timezone subclassing details to specific section. We'll be filling a new issue for that patch. |
|
LGTM |
|
On the second reading, I have a few issues with the patch.
|
|
To clarify:
Sorry about any inconvenience. |
It seems that any sentence we add to that effect will be simply restating the definitions of UTC, timezones and DST (and their mathematical relationships). That is, "utcoffset will be negative when dt.tzinfo + dst() is negative". Perhaps we could include a more detailed discusion about the sign of utcoffset() on the larger doc patch I've mentioned? Or do you have any suggestions? |
|
I've noticed that the time module docstring handles this issue rather nicely: >>> help('time')
...
timezone -- difference in seconds between UTC and local standard time
altzone -- difference in seconds between UTC and local DST timeWe can use similar language for utcoffset(): "difference between local time and UTC expressed as a timedelta". |
|
Well, we have a patch and it's been discussed here and on bpo-7229, so can we take this forward? |
|
This seems to be touching the same areas as bpo-9305. |
|
Assuming you meant bpo-8810, yes these patches would collide with each other. I am yet to look at the patches, but I gess they should be merged. |
|
Would one of the original authors of the patches like to create a GitHub pull request for this issue? |
|
I would like to work on this issue. Please assign this to me. |
|
I am taking up this issue. |
|
Are you still working on this Ajay Mahato? |
|
Closed per comment |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

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: