Re: [Numpy-discussion] UTC-based datetime64

2015-09-01 Thread Jim Benson
On Tue, Sep 01, 2015 at 05:28:56PM -0700, Chris Barker wrote: > > Googling for a way to print UTC out of the box, the best thing I could > > find is: > > > > In [40]: [str(i.item()) for i in np.array([t], dtype="datetime64[s]")] > > Out[40]: ['2015-08-26 11:52:10'] > > > > Now, is there a better wa

[Numpy-discussion] UTC-based datetime64

2015-09-01 Thread Chris Barker
> Googling for a way to print UTC out of the box, the best thing I could > find is: > > In [40]: [str(i.item()) for i in np.array([t], dtype="datetime64[s]")] > Out[40]: ['2015-08-26 11:52:10'] > > Now, is there a better way to specify that I want the datetimes printed > always in UTC? > maybe, bu

[Numpy-discussion] UTC-based datetime64

2015-08-26 Thread Francesc Alted
Hi, We've found that NumPy uses the local TZ for printing datetime64 timestamps: In [22]: t = datetime.utcnow() In [23]: print t 2015-08-26 11:52:10.662745 In [24]: np.array([t], dtype="datetime64[s]") Out[24]: array(['2015-08-26T13:52:10+0200'], dtype='datetime64[s]') Googling for a way to pr