Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64947

Re: pytz question: GMT vs. UTC

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'preferred.': 0.05; 'correct,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:question': 0.10; 'python': 0.11; "(i'm": 0.16; 'contexts,': 0.16; 'defined,': 0.16; 'finney': 0.16; 'implies': 0.16; 'informal': 0.16; 'precedence': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'timestamp': 0.16; 'timezones': 0.16; 'unambiguous': 0.16; 'utc': 0.16; 'url:)': 0.16; '>>>': 0.22; 'saying': 0.22; 'header:User- Agent:1': 0.23; 'precise': 0.24; 'skip': 0.24; 'unicode': 0.24; 'compare': 0.26; 'asking': 0.27; 'values': 0.27; 'header:X -Complaints-To:1': 0.27; '(like': 0.30; 'nature': 0.30; 'url:wiki': 0.31; 'doc': 0.31; 'universal': 0.31; 'url:wikipedia': 0.31; 'writes:': 0.31; "i'd": 0.34; 'created': 0.35; 'convert': 0.35; 'objects': 0.35; 'false': 0.36; 'received:com.au': 0.36; 'possible': 0.36; 'url:org': 0.36; 'two': 0.37; 'ben': 0.38; 'same.': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'either': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'according': 0.40; 'complete': 0.62; 'within': 0.65; 'subject:. ': 0.67; 'ato': 0.84; 'greenwich': 0.84; 'received:125': 0.84; 'relations,': 0.84; 'to/from': 0.84; 'canonical': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: pytz question: GMT vs. UTC
Date Thu, 30 Jan 2014 05:45:53 +1100
References <CANc-5UwG556iz9qewe2Ltw-TzsGt3EA0CXqq9R85Di-DVg8MEA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host vmx15867.hosting24.com.au
X-Public-Key-ID 0xBD41714B
X-Public-Key-Fingerprint 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-gpg.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock sha1:+CTGot+QZIQgHrphdUiNYBdZIMU=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6095.1391021168.18130.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391021168 news.xs4all.nl 2915 [2001:888:2000:d::a6]:55234
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64947

Show key headers only | View raw


Skip Montanaro <skip@pobox.com> writes:

> According ato the pytz doc (http://pytz.sourceforge.net/):
>
> "‘UTC’ is Universal Time, also known as Greenwich Mean Time or GMT in
> the United Kingdom."

This is inaccurate, and I'd like to see it corrected in the
documentation. UTC is neither UT nor GMT.

GMT is not precisely defined, which makes it unsuitable for keeping
precise time in a computer system.

> If they are equal, why don't timezone objects created from those two
> strings compare equal?
>
> >>> pytz.timezone("UTC") == pytz.timezone("GMT")
> False

Python is correct, the timezones are not the same.

See <URL:https://en.wikipedia.org/wiki/Coordinated_Universal_Time> and
<URL:https://en.wikipedia.org/wiki/Greenwich_Mean_Time>. From the
former:

    Saying "GMT" often implies either UTC or UT1 when used within
    informal or casual contexts. In technical contexts, usage of "GMT"
    is avoided; the unambiguous terminology "UTC" or "UT1" is preferred.

> (I'm revealing my complete ignorance of timezone manipulation by
> asking this question.)

Treat GMT like any other locale-specific timezone, and convert to/from
it as late/early as possible (like a locale-specific encoding).

Treat UTC as the canonical timezone for keeping all timestamp values in
(like Unicode for text).

-- 
 \     “Reality must take precedence over public relations, for nature |
  `\                            cannot be fooled.” —Richard P. Feynman |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: pytz question: GMT vs. UTC Ben Finney <ben+python@benfinney.id.au> - 2014-01-30 05:45 +1100

csiph-web