[Datetime-SIG] What's are the issues?

Chris Barker chris.barker at noaa.gov
Wed Jul 29 21:39:58 CEST 2015


On Wed, Jul 29, 2015 at 10:42 AM, Łukasz Rekucki <lrekucki at gmail.com> wrote:

> On 29 July 2015 at 19:37, Alexander Belopolsky
> <alexander.belopolsky at gmail.com> wrote:
> > For example, "Find a day with the largest trading volume on the New
> > York Stock Exchange in 2014."
>
> > The exchange publishes its data in New York local time and you know
> > that trading hours are from 09:30 to 16:00 with a few exceptions that
> > are again published in the local time.
>

<snip>


> The database is huge, so you
> > select the data by day, split it into chunks by 5 minutes, add up the
> > volumes for each day
> > and find maximum.  Easy.  No need to know when the DST transitions
> > were in New York in 2014.  Got the same database from Paris?  No need
> > to change your code.
>

That's because your program does not need to be time zone aware *at
> all* (it works on Local Datetime). Everyone already agrees that this
> work.


exactly -- this is where and why naive datetimes are, in fact very, very
useful.
And see Skip's message -- I guess I haven't drunk the cool aid, but I agree
that going full-on timezone aware would make this kind of thing harder.

For me, I think of naive datetimes as meaning "I know all the data i"m
working with right now is in the same timezone (and I don't care about DST)"

So no -- this is not an example of wanting to do time arithmetic in the
messy, DST aware, non-contiguous realm...

But I don't think anyone is proposing removing naive datetimes anyway.

  Now try to do the same in UTC.  I think my
> > program will finish before you stop arguing what "a day" is.
>

actually -- it would hardly make it any harder, if we had "proper" time
zone support:

You'd load your data into datetime objects, letting it know that it's in
the US Eastern Time zone. then do all the same things -- datetime would
deal with it for you.

For Paris, you *would* have to tell your script what timezone it's in.

But again, if that isn't in the dataset, then naive is what you want.

-Chris


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150729/7574f96a/attachment-0001.html>


More information about the Datetime-SIG mailing list