Re: [Numpy-discussion] timezones and datetime64

2013-04-09 Thread Jonathan Tu
On Thu, Apr 4, 2013 at 12:52 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Thanks all for taking an interest. I need to think a bot more about the options before commenting more, but: while we're at it: It seems very odd to me that datetime64 supports different units (right

Re: [Numpy-discussion] timezones and datetime64

2013-04-05 Thread Daniele Nicolodi
On 04/04/2013 15:34, Jonathan T. Niehof wrote: Keeping a leap second database up to date is annoying but not as bad as it could be: they're not arbitrary. Although they can occur monthly, they've only ever happened at June 30 and Dec 31, announced in January and July, respectively. So it

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Daniele Nicolodi
On 04/04/2013 01:27, Pauli Virtanen wrote: Probably also TAI and UTC/Posix. Converting from one format to the other is problematic since all of them (except TAI afaik) require looking things up in regularly updated databases. Not only restricted to conversions, but also arithmetic, `b -

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Daπid
On 4 April 2013 11:03, Daniele Nicolodi dani...@grinta.net wrote: I think that generally the issue is not relevant for any practical use of a timebase: there are not many applications requiring sub-second accuracy over many years periods. I agree. I think the basic datetime object should

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Nathaniel Smith
On Thu, Apr 4, 2013 at 12:52 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Thanks all for taking an interest. I need to think a bot more about the options before commenting more, but: while we're at it: It seems very odd to me that datetime64 supports different units (right

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Jonathan T. Niehof
On 04/04/2013 03:03 AM, Daniele Nicolodi wrote: I'm not aware of any library that handles the conversion from UTC to TAI. I would like to know if there is one. The CDF library does, although that's rather a sledgehammer to drive a thumbtack. I think that generally the issue is not relevant

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Francesc Alted
On 4/4/13 1:52 AM, Chris Barker - NOAA Federal wrote: Thanks all for taking an interest. I need to think a bot more about the options before commenting more, but: while we're at it: It seems very odd to me that datetime64 supports different units (right down to attosecond) but not

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Francesc Alted
On 4/4/13 1:54 PM, Nathaniel Smith wrote: On Thu, Apr 4, 2013 at 12:52 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Thanks all for taking an interest. I need to think a bot more about the options before commenting more, but: while we're at it: It seems very odd to me that

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Chris Barker - NOAA Federal
On Wed, Apr 3, 2013 at 6:02 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Apr 3, 2013 at 4:27 PM, Pauli Virtanen p...@iki.fi wrote: Probably also TAI and UTC/Posix. Converting from one format to the other is problematic since all of them (except TAI afaik) require looking things up in

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Charles R Harris
On Thu, Apr 4, 2013 at 11:01 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Wed, Apr 3, 2013 at 6:02 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Apr 3, 2013 at 4:27 PM, Pauli Virtanen p...@iki.fi wrote: Probably also TAI and UTC/Posix. Converting from one format to

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Nathaniel Smith
On Thu, Apr 4, 2013 at 6:06 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 4, 2013 at 11:01 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Wed, Apr 3, 2013 at 6:02 PM, Mark Wiebe mwwi...@gmail.com wrote: One problem with trying to give technically

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Francesc Alted
On 4/4/13 8:56 PM, Chris Barker - NOAA Federal wrote: On Thu, Apr 4, 2013 at 10:54 AM, Francesc Alted franc...@continuum.io wrote: That makes a difference. This can be specially important for creating user-defined time origins: In []: np.array(int(1.5e9), dtype='datetime64[s]') +

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Dave Hirschfeld
Andreas Hilboll lists at hilboll.de writes: I think your point about using current timezone in interpreting user input being dangerous is probably correct --- perhaps UTC all the way would be a safer (and simpler) choice? +1 +10 from me! I've recently come across a bug due to

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Nathaniel Smith
On Wed, Apr 3, 2013 at 2:26 PM, Dave Hirschfeld dave.hirschf...@gmail.com wrote: Andreas Hilboll lists at hilboll.de writes: I think your point about using current timezone in interpreting user input being dangerous is probably correct --- perhaps UTC all the way would be a safer (and

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Dave Hirschfeld
Nathaniel Smith njs at pobox.com writes: On Wed, Apr 3, 2013 at 2:26 PM, Dave Hirschfeld dave.hirschfeld at gmail.com wrote: This isn't acceptable for my use case (in a multinational company) and I found no reasonable way around it other than bypassing the numpy conversion entirely

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Chris Barker - NOAA Federal
dave.hirschf...@gmail.com wrote: I found no reasonable way around it other than bypassing the numpy conversion entirely Exactly - we have come to the same conclusion. By the way, it's also consistent -- an ISO string without a TZ is interpreted as a to mean use the locale, but a datetime

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Travis Oliphant
Mark Wiebe and I are both still tracking NumPy development and can provide context and even help when needed.Apologies if we've left a different impression. We have to be prudent about the time we spend as we have other projects we are pursuing as well, but we help clients with NumPy issues

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Mark Wiebe
On Wed, Apr 3, 2013 at 9:33 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: dave.hirschf...@gmail.com wrote: I found no reasonable way around it other than bypassing the numpy conversion entirely Exactly - we have come to the same conclusion. By the way, it's also consistent

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Benjamin Root
On Wed, Apr 3, 2013 at 7:52 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Personally, I never need finer resolution than seconds, nor more than a century, so it's no big deal to me, but just wondering A use case for finer resolution than seconds (in our field, no less!)

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Warren Weckesser
On 4/3/13, Benjamin Root ben.r...@ou.edu wrote: On Wed, Apr 3, 2013 at 7:52 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Personally, I never need finer resolution than seconds, nor more than a century, so it's no big deal to me, but just wondering A use case for finer

Re: [Numpy-discussion] timezones and datetime64

2013-04-02 Thread Pauli Virtanen
02.04.2013 22:42, Chris Barker - NOAA Federal kirjoitti: [clip] As I poke at this a bit, Im noticing that maybe time zones aren't handles at all internally -- rather, the conversion is done to UTC when creating a datetime64, and conversion is then done to the locale when creating a strng

Re: [Numpy-discussion] timezones and datetime64

2013-04-02 Thread Chris Barker - NOAA Federal
On Tue, Apr 2, 2013 at 2:39 PM, Pauli Virtanen p...@iki.fi wrote: As far as I understand (more knowledgeable people, please correct me), Numpy's datetime handling in 1.7 is timezone-agnostic and works in UTC (which is not a time zone). That is, datetime64 represents an absolute point in time,