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


Groups > comp.lang.python > #78733

Re: Timezones

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.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.047
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'dst': 0.09; 'e.g.,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; 'changes': 0.15; '"right"': 0.16; 'illustrate': 0.16; 'investigate': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'resolved:': 0.16; 'sunset': 0.16; 'timezones': 0.16; 'utc': 0.16; 'video.': 0.16; 'written': 0.21; 'rules': 0.22; 'header:User-Agent:1': 0.23; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'fixed': 0.29; '[1]': 0.29; "doesn't": 0.30; '[2]': 0.30; 'info.': 0.31; 'writes:': 0.31; 'quite': 0.32; 'could': 0.34; 'convert': 0.35; 'etc': 0.35; 'but': 0.35; 'transition': 0.36; 'possible': 0.36; 'url:org': 0.36; 'should': 0.36; 'seconds': 0.37; 'wrong': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'legally': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'easy': 0.60; 'most': 0.60; 'mentioned': 0.61; 'new': 0.61; 'such': 0.63; 'different': 0.65; 'between': 0.67; 'video,': 0.68; 'url:v': 0.71; 'url:youtube': 0.71; 'pictures': 0.72; 'day': 0.76; 'url:watch': 0.77; 'politicians': 0.84; 'url:master': 0.84; 'received:89': 0.85; 'rocket': 0.95; 'yourself,': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Akira Li <4kir4.1i@gmail.com>
Subject Re: Timezones
Date Mon, 06 Oct 2014 05:10:26 +0400
References <h9d33a5s1cohpr5stutbeop79cgoq2e5lk@4ax.com>
Mime-Version 1.0
Content-Type text/plain
X-Gmane-NNTP-Posting-Host 89.169.229.68
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:vCo/DstgoJ0VWKQjuIbnTd+y4E4=
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.14622.1412557854.18130.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1412557854 news.xs4all.nl 2903 [2001:888:2000:d::a6]:51468
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78733

Show key headers only | View raw


Seymore4Head <Seymore4Head@Hotmail.invalid> writes:

> This is not a new video, but it is new to me.
> https://www.youtube.com/watch?v=-5wpm-gesOY
>
> Any links to some easy to follow time zone math?

The point of the video is that you should not do it yourself, use
already written tools.

It is quite comprehensive video. Here's how the mentioned issues could
be resolved:

- erratic UTC offset changes by politicians in different countries --
  *use UTC timezone* for calculations, in addition (if necessary) store
  both the local time and timezone info. *Use pytz module* that provides
  access to the tz database to convert between timezones (many people
  get it wrong but it is not a rocket science). As said in the video, it
  won't help if the rules change a day before the DST transition but at
  least most [1] systems will be consistent. It also doesn't support
  some exotic timezone rules such as in Saudi Arabia (sunrise and/or
  sunset at the fixed local time every day [2]) or many timezones before
  1970.

- julian, gregorian calendars, proleptic UT (past dates): *use proleptic
  gregorian calendar (datetime module)* unless you know that you need
  otherwise (then you could investigate what JD means in a particular
  document given multiple possible interpretations)

- leap seconds (posix, Mills, Windows(ntp), smear (google, java)),
  "right" timezones, and the difference between UT1, UTC(BIMP), GPS,
  TT(TAI), TCB, etc time scales: *ignore them* unless you know that you
  need otherwise e.g., legally elapsed seconds [3]. Here's some pictures
  to illustrate the difference between time scales [4].

[1] http://www.iana.org/time-zones/repository/tz-link.html
[2] https://github.com/eggert/tz/blob/master/asia#L2439
[3] http://www.ucolick.org/~sla/leapsecs/epochtime.html
[4] http://www.ucolick.org/~sla/leapsecs/deltat.html


--
Akira

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


Thread

Timezones Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-05 17:17 -0400
  Re: Timezones Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-05 23:15 +0100
    Re: Timezones Rustom Mody <rustompmody@gmail.com> - 2014-10-05 19:37 -0700
      Re: Timezones Chris Angelico <rosuav@gmail.com> - 2014-10-06 13:48 +1100
        Re: Timezones Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-07 17:26 -0400
  Re: Timezones Akira Li <4kir4.1i@gmail.com> - 2014-10-06 05:10 +0400

csiph-web